fix(gateway): enable text-intercept for multi-choice clarify fallback#25587
Closed
zccyman wants to merge 1 commit into
Closed
fix(gateway): enable text-intercept for multi-choice clarify fallback#25587zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
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! |
Contributor
Author
|
Thanks @teknium1 for cherry-picking! Glad the clarify text-fallback fix made it in. 🙏 |
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.
Problem
In
gateway/platforms/base.py, the defaultsend_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 withawaiting_text=False(because choices exist), soget_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 ofsend_clarify(), after building the text fallback message, callmark_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: Addedmark_awaiting_text(clarify_id)call in the text fallback path ofsend_clarify(). Updated the docstring to document this behavior.tests/tools/test_clarify_gateway.py: Addedtest_text_fallback_enables_awaiting_text_for_multi_choiceto verify the fix.Fixes #25567