feat(discord): make interactive view timeout configurable via approvals.discord_prompt_timeout - #45904
Closed
cruzanstx wants to merge 1 commit into
Closed
Conversation
ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView all hardcoded their button-view lifetime to 300s. Users on long-running sessions who step away briefly come back to "Prompt expired — no action taken" with no config knob to extend it. Add `approvals.discord_prompt_timeout` (seconds). Default 300s preserves existing behavior; clamped to [30, 900] so a typo can't make prompts disappear (too short) or outlive Discord's ~15-minute interaction-token expiry (too long). ModelPickerView's 120s timeout is intentionally left alone — that view is a quick-pick UX surface, not a confirmation, and conflating them would make the picker feel sluggish. A crashing read_raw_config falls through to the historical default rather than failing view construction, so a corrupt config file can't lock the user out of the approval flow. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
AIalliAI
added a commit
to AIalliAI/Hermes
that referenced
this pull request
Jun 14, 2026
AIalliAI
added a commit
to AIalliAI/Hermes
that referenced
this pull request
Jun 14, 2026
teknium1
added a commit
that referenced
this pull request
Jul 7, 2026
Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR #45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
Contributor
|
Merged via #60230 - the timeout portion of your PR was reapplied with credit (Co-authored-by, commit afb5808; direct cherry-pick was not possible because the commit was authored under a placeholder identity). The channel-context/embed-backfill changes bundled in the same commit were intentionally excluded - they will be evaluated with the thread-context-backfill PRs. Thanks! |
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…ch#60230) Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR NousResearch#45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
…ch#60230) Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR NousResearch#45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…ch#60230) Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR NousResearch#45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…ch#60230) Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR NousResearch#45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
…ch#60230) Discord's ExecApprovalView, SlashConfirmView, UpdatePromptView, and ClarifyChoiceView hardcoded timeout=300, ignoring approval timeout configuration. All four now read approvals.discord_prompt_timeout from config.yaml (default 300s, clamped 30-900s — Discord interaction tokens expire at ~15 min, so values beyond 900s would render dead buttons). Surgical reapply of the timeout portion of PR NousResearch#45904; the unrelated channel-context changes bundled in that PR were intentionally excluded. Co-authored-by: cruzanstx <cruzanstx@users.noreply.github.com>
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.
Summary
Fixes #45903 — Discord interactive views (
ExecApprovalView,SlashConfirmView,UpdatePromptView,ClarifyChoiceView) all hardcoded theirtimeout=to 300s with no config exposure. Users who walk away from a long session for >5 min lose the UI affordance even though the underlying agent thread is still parked.Adds
approvals.discord_prompt_timeout(seconds). Default 300s preserves existing behavior; clamped to[30, 900]so:5) can't make prompts disappear before the user can read themModelPickerViewintentionally keeps its 120s timeout — that view is a quick-pick UX surface, not a confirmation, and reusing the same knob would make the picker feel sluggish at higher values.A crashing
read_raw_config(corrupt config file) falls through to the historical 300s default rather than blowing up view construction.Implementation
_read_discord_prompt_timeout()next to_read_dm_role_auth_guild()— same pattern, same defensive shape_DISCORD_PROMPT_TIMEOUT_DEFAULT = 300,_MIN = 30,_MAX = 900as module constants so tests can assert behavioral paritysuper().__init__(timeout=300)sites replaced withtimeout=_read_discord_prompt_timeout()Test plan
tests/gateway/test_discord_prompt_timeout_config.pycovering: default-on-missing-config, default-on-missing-block, default-on-missing-key, explicit int, numeric string, malformed value, clamp-low, clamp-high, zero, negative, empty string, config-read exception, 300s parity assertion, clamp-range-includes-default invariantGenerated with Claude Code via Happy