[GH-ISSUE #2204] [FEAT]: Timeout config for @agent #1437

Closed
opened 2026-02-22 18:24:47 -05:00 by yindo · 4 comments
Owner

Originally created by @timothycarambat on GitHub (Aug 30, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2204

What would you like to see?

When using agents it is not impossible that an @agent invocation or steps could take longer than 30s for the response to complete inferencing depending on the user hardware.

This should either be a directly editable configuration or simply a passive ENV key we can support in the allowable ENV key directory.

Socket is currently 5min
https://github.com/Mintplex-Labs/anything-llm/blob/12df88b2c5d1e9e253e99ef5664a0c2a166f032e/server/utils/agents/aibitat/plugins/websocket.js#L4

But discord message shows an error for longer than 30s

responses that take longer than 30s to complete:
https://discord.com/channels/1114740394715004990/1276498687044096041

Originally created by @timothycarambat on GitHub (Aug 30, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2204 ### What would you like to see? When using agents it is not impossible that an `@agent` invocation or steps could take longer than 30s for the response to complete inferencing depending on the user hardware. This should either be a directly editable configuration or simply a passive ENV key we can support in the allowable ENV key directory. Socket is currently 5min https://github.com/Mintplex-Labs/anything-llm/blob/12df88b2c5d1e9e253e99ef5664a0c2a166f032e/server/utils/agents/aibitat/plugins/websocket.js#L4 But discord message shows an error for longer than 30s > responses that take longer than 30s to complete: https://discord.com/channels/1114740394715004990/1276498687044096041
yindo added the enhancementfeature request labels 2026-02-22 18:24:47 -05:00
yindo closed this issue 2026-02-22 18:24:47 -05:00
Author
Owner

@0xLyon commented on GitHub (Aug 30, 2024):

Thanks @timothycarambat this would be greatly appreciated. I rate ENV variable to allow custom timeout would be a good way to tackle this.

@0xLyon commented on GitHub (Aug 30, 2024): Thanks @timothycarambat this would be greatly appreciated. I rate ENV variable to allow custom timeout would be a good way to tackle this.
Author
Owner

@gordan-bobic commented on GitHub (Feb 7, 2025):

If the solution is changing the timeout here:

 const SOCKET_TIMEOUT_MS = 300 * 1_000; // 5 mins 

It doesn't work for me. If the LLM has to think for a bit, I end up with only:

1/1 Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early.
2/2 Agent session complete.

and nothing else as the response.
How can I bump this by a lot?

@gordan-bobic commented on GitHub (Feb 7, 2025): If the solution is changing the timeout here: ``` const SOCKET_TIMEOUT_MS = 300 * 1_000; // 5 mins ``` It doesn't work for me. If the LLM has to think for a bit, I end up with only: ``` 1/1 Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early. 2/2 Agent session complete. ``` and nothing else as the response. How can I bump this by a lot?
Author
Owner

@timothycarambat commented on GitHub (Feb 7, 2025):

Since it is statically set in the code that would require code change. That being said 5 minutes for inference is incredibly long to wait. Are you sure you would like to wait 10 minutes or more just to get an agent response?

@timothycarambat commented on GitHub (Feb 7, 2025): Since it is statically set in the code that would require code change. That being said 5 minutes for inference is _incredibly long to wait_. Are you sure you would like to wait 10 minutes or more just to get an agent response?
Author
Owner

@gordan-bobic commented on GitHub (Feb 7, 2025):

Well, something times out for sure, and it's not 5 minutes. It's more like 1-2 minutes.
I changed that line to:

 const SOCKET_TIMEOUT_MS = 1800 * 1_000; // 5 mins 

and it made no difference. So something else is going on.
I'd also be OK if it was always running in agent mode.

@gordan-bobic commented on GitHub (Feb 7, 2025): Well, something times out for sure, and it's not 5 minutes. It's more like 1-2 minutes. I changed that line to: ``` const SOCKET_TIMEOUT_MS = 1800 * 1_000; // 5 mins ``` and it made no difference. So something else is going on. I'd also be OK if it was always running in agent mode.
yindo changed title from [FEAT]: Timeout config for `@agent` to [GH-ISSUE #2204] [FEAT]: Timeout config for `@agent` 2026-06-05 14:40:46 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1437