Conversation
Overall: Aligns the Discord clarify button view's lifetime with the gateway's actual clarify wait. What it does
Non-blocking notes
Non-blocking — please use your judgment. |
|
I added concrete lifecycle reproductions to the existing issue: #97662 (comment). I am consolidating my overlapping #104916 there rather than keeping another tracker open. This also supports the earlier review's note about retiring resolved views. Against main source at
Would you prefer to include terminal-view cleanup and render-after-acceptance handling in this PR, or keep them as a coordinated follow-up under #97662? The issue comment includes pinned source anchors, test setup and limits, and proposed regression cases. Pending execution approvals should retain their separately bounded timeout. This evidence is against the pinned main source, not a test of this PR's head. It supports the existing cleanup acceptance criteria without proposing a different timeout policy. |
What does this PR do?
Discord native-choice
clarifyprompts currently have two independent lifetimes:ClarifyChoiceViewusesapprovals.discord_prompt_timeout(300 seconds by default, capped at 900 seconds).agent.clarify_timeout(3600 seconds by default;<= 0means unlimited).After five minutes, Discord disables the buttons and says the prompt expired even though Hermes may still be waiting for up to another 55 minutes—or forever when clarify is configured as unlimited.
This PR makes the Discord clarify view use the same canonical clarify timeout as the gateway waiter:
discord.ui.View(timeout=None), matching the documented unlimited wait;approvals.discord_prompt_timeout.It also fixes the cancellation sentinel for an unlimited wait. A session interruption previously produced
[user did not respond within 0m]; it now reports[clarify wait cancelled before user response].Related work
Related but intentionally different from #72742.
#72742 keeps the five-minute Discord view deadline, then introduces a second typed-answer grace timer and eventually resolves the waiter with an empty response. This PR instead removes the deadline split at its source. That preserves the documented
agent.clarify_timeout <= 0unlimited contract and avoids another timer/task/race lifecycle.Type of change
Changes
_read_discord_clarify_timeout()using the canonical clarify resolver.ClarifyChoiceView; approval/confirmation views stay bounded.0msentinel.Test plan
The new tests were first run against the old behavior and failed as expected:
300, notNone.[user did not respond within 0m].After the fix:
Live verification on Discord/Linux:
agent.clarify_timeout: 0None300Checklist
CONTRIBUTING.md