fix(gateway): mark text-capture mode when base send_clarify renders choices as text#25584
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(gateway): mark text-capture mode when base send_clarify renders choices as text#25584liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
This was referenced May 14, 2026
Closed
…hoices as text When the default send_clarify renders multiple choices as a numbered text list (platforms without inline buttons, e.g. Mattermost), the entry's awaiting_text flag remained False. get_pending_for_session only returns entries with awaiting_text=True, so the user's text reply was never intercepted and the agent timed out after 10 minutes. Fix: call mark_awaiting_text(clarify_id) after rendering choices as text in the base implementation. Adapters that override send_clarify with inline buttons (Telegram, Discord) do NOT reach this code path — they resolve via button callbacks instead. Fixes Bug: clarify multiple-choice text fallback never intercepts user reply on Mattermost NousResearch#25567
6d04ad7 to
e772be3
Compare
13 tasks
Contributor
|
This appears to be implemented on current main already. Automated hermes-sweeper review evidence:
Thanks for the clear root-cause writeup here; the behavior this PR targets is now covered by the landed mainline fix. |
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.
What does this PR do?
When
clarifyis called with multiple choices on platforms that don't support inline buttons (Mattermost, etc.), the defaultsend_clarifyinBasePlatformAdapterrenders choices as a numbered text list. The user replies with a number or text, but the gateway's text-intercept never fires becauseawaiting_textremainsFalse. The agent blocks for 10 minutes and then times out.Root Cause
clarify_gateway.register()setsawaiting_text = not bool(choices)(line 95). When choices are provided,awaiting_textisFalse.get_pending_for_session()(line 178) only returns entries withawaiting_text == True, so the user's text reply is never matched.The base
send_clarifyingateway/platforms/base.pyrenders choices as text but never callsmark_awaiting_text(clarify_id)to flip the flag. Adapters with inline buttons (Telegram, Discord) overridesend_clarifyand resolve via button callbacks -- they don't hit this code path.Related Issue
N/A
Type of Change
Changes Made
How to Test
pytest tests/ -q— all tests should passChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture and workflows — or N/ACode Intelligence
GitNexus unavailable -- analysis skipped, grep-based fallback used.
get_pending_for_sessioncalled fromgateway/run.py:5871andgateway/platforms/base.py:2899-- both are text-intercept pathsmark_awaiting_textcalled fromgateway/platforms/telegram.py:2814(button callback) -- confirms button platforms handle it separatelysend_clarifypath; adapters with button overrides are unaffectedFixes Bug: clarify multiple-choice text fallback never intercepts user reply on Mattermost #25567