Skip to content

fix(gateway): enable text-intercept for multi-choice clarify fallback#25587

Closed
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/zccyman/clarify-text-fallback-intercept
Closed

fix(gateway): enable text-intercept for multi-choice clarify fallback#25587
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/zccyman/clarify-text-fallback-intercept

Conversation

@zccyman

@zccyman zccyman commented May 14, 2026

Copy link
Copy Markdown
Contributor

Problem

In gateway/platforms/base.py, the default send_clarify() method renders multiple-choice questions as a numbered text list for platforms without inline buttons (Mattermost, Slack webhooks, etc.). The message says "Reply with the number, the option text, or your own answer" — but the clarify entry was registered with awaiting_text=False (because choices exist), so get_pending_for_session() never returns it and the gateway's text-intercept never fires. The user types a reply, and the agent silently times out after 10 minutes.

Fix

In the if choices: block of send_clarify(), after building the text fallback message, call mark_awaiting_text(clarify_id) to flip the entry into text-capture mode. This mirrors what button-enabled adapters already do when the user clicks the "Other" / free-text option.

Changes

  • gateway/platforms/base.py: Added mark_awaiting_text(clarify_id) call in the text fallback path of send_clarify(). Updated the docstring to document this behavior.
  • tests/tools/test_clarify_gateway.py: Added test_text_fallback_enables_awaiting_text_for_multi_choice to verify the fix.

Fixes #25567

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists labels May 14, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #25778 (cherry-picked onto current main with your authorship preserved). Wire mark_awaiting_text in clarify text-fallback path. Thanks for the contribution!

@teknium1 teknium1 closed this May 14, 2026
@zccyman

zccyman commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @teknium1 for cherry-picking! Glad the clarify text-fallback fix made it in. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: clarify multiple-choice text fallback never intercepts user reply on Mattermost

3 participants