fix(discord): add timeout to typing indicator HTTP request to prevent stuck loop - #64910
Closed
kyssta-exe wants to merge 2 commits into
Closed
kyssta-exe wants to merge 2 commits into
kyssta-exe wants to merge 2 commits into
Conversation
added 2 commits
July 15, 2026 10:33
…on_id when session_key is unset When delegate_task is dispatched from a CLI/Desktop session that lacks an explicit session_key ContextVar, the completion event arrives with an empty session_key — causing _session_owns_notification_event() to return False and the result to be silently dropped as an orphan. Since parent_session_id (the agent's durable state.db session_id) is always captured at dispatch time, use it as a routing fallback when session_key is empty. The TUI session's lookup key resolves to the same agent.session_id, so the event correctly reaches its originating session. Fixes NousResearch#64901
… stuck loop The _typing_loop makes a raw HTTP request to Discord's typing endpoint with no timeout. If the request hangs (network blip, Discord API stall), the task gets stuck forever — stop_typing blocks awaiting the stuck task and the typing indicator never clears. Wrap the request with asyncio.wait_for(..., timeout=10) so a hung call raises asyncio.TimeoutError, which the existing except Exception handler catches and logs cleanly. Fixes NousResearch#64874
This was referenced Aug 13, 2026
Closed
1 task
5 tasks
Contributor
Author
|
Closing due to merge conflicts — this PR is in |
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
_typing_loopin the Discord adapter makes a raw HTTP request to Discord's typing endpoint with no timeout. If the request hangs (network blip, Discord API stall, WS reconnect), the task gets stuck forever —stop_typingblocks awaiting the stuck task and the typing indicator never clears.Wrap the request with
asyncio.wait_for(..., timeout=10)so a hung call raisesasyncio.TimeoutError, which the existingexcept Exceptionhandler catches and logs cleanly.Fixes #64874