chore: Adjust timeout for subscriber readiness in ResumableAgentController

- Reduced the timeout duration from 5000ms to 2500ms in the startGeneration function to improve responsiveness when waiting for subscriber readiness. This change aims to enhance the efficiency of the agent's background generation process.
This commit is contained in:
Danny Avila 2025-12-12 02:37:11 -05:00
parent 9fb7594ebe
commit 696961df6c
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -166,7 +166,7 @@ const ResumableAgentController = async (req, res, next, initializeClient, addTit
// Start background generation - wait for subscriber with timeout fallback
const startGeneration = async () => {
try {
await Promise.race([job.readyPromise, new Promise((resolve) => setTimeout(resolve, 5000))]);
await Promise.race([job.readyPromise, new Promise((resolve) => setTimeout(resolve, 2500))]);
} catch (waitError) {
logger.warn(
`[ResumableAgentController] Error waiting for subscriber: ${waitError.message}`,