Conversation
mrshu
marked this pull request as ready for review
April 8, 2026 10:05
Contributor
Author
|
@teknium1 another thing I came across -- feel free to let me know if this works |
mrshu
force-pushed
the
mrshu/fix-approvals
branch
from
April 8, 2026 10:08
2abe94a to
a493093
Compare
Collaborator
|
Thanks for identifying the FIFO/request-binding issue. The underlying premise is still present on current Problems
Suggested changes
Automated hermes-sweeper review. |
mrshu
force-pushed
the
mrshu/fix-approvals
branch
from
July 12, 2026 18:03
a493093 to
b9daaed
Compare
Contributor
Author
|
@teknium1 Thanks for the detailed salvage guidance. I rebuilt this on current main and force-updated the PR as one focused commit.
The branch is ready for another look. |
Previously interactive controls resolved the oldest queued approval; this commit binds each control to its pending request without changing text FIFO. Existing per-platform authorization checks remain ahead of resolution. - Add stable request IDs and targeted gateway queue resolution - Thread request IDs through all live interactive gateway adapters - Cover exact queue and adapter payload routing in gateway tests
mrshu
force-pushed
the
mrshu/fix-approvals
branch
from
July 12, 2026 18:08
b9daaed to
f72d7c0
Compare
13 tasks
liuhao1024
added a commit
to liuhao1024/hermes-agent
that referenced
this pull request
Sep 7, 2026
…ers (NousResearch#104915) Bind every interactive exec-approval card to the request generation it was issued for, so a stale or overlapping control can no longer settle a different pending approval: - the entry side stamps an immutable request_id (uuid) onto every approval entry (tools/approval_gateway_wait.py) and the gateway notify path forwards it (gateway/run_turn_runner.py); - all nine native interactive adapters (Discord, Slack, Teams, Matrix, Feishu, Telegram, QQBot, WhatsApp Cloud, relay) thread the keyword through send_exec_approval and resolve by request id, fail-closed when unbound; - external/plugin adapters predating the converged signature fail closed to the typed-text prompt instead of rendering an unbound interactive control; - WhatsApp Cloud keeps (session_key, request_id) as ONE bounded FIFO record (single-record tuple shape per the older NousResearch#87554 carrier), so eviction beyond INTERACTIVE_STATE_CACHE_SIZE drops both halves together. Authorship lineage: exact-request-binding design credit goes to NousResearch#6105 (first implementation) and NousResearch#87554 (native-adapter carrier incl. the bounded tuple shape adopted here); the broader non-native surfaces rewrite in NousResearch#68080 stays complementary.
liuhao1024
added a commit
to liuhao1024/hermes-agent
that referenced
this pull request
Sep 7, 2026
…ers (NousResearch#104915) Bind every interactive exec-approval card to the request generation it was issued for, so a stale or overlapping control can no longer settle a different pending approval: - the entry side stamps an immutable request_id (uuid) onto every approval entry (tools/approval_gateway_wait.py) and the gateway notify path forwards it (gateway/run_turn_runner.py); - all nine native interactive adapters (Discord, Slack, Teams, Matrix, Feishu, Telegram, QQBot, WhatsApp Cloud, relay) thread the keyword through send_exec_approval and resolve by request id, fail-closed when unbound; - external/plugin adapters predating the converged signature fail closed to the typed-text prompt instead of rendering an unbound interactive control; - WhatsApp Cloud keeps (session_key, request_id) as ONE bounded FIFO record (single-record tuple shape per the older NousResearch#87554 carrier), so eviction beyond INTERACTIVE_STATE_CACHE_SIZE drops both halves together; - the Discord request-bound approval-card owner lives in its topical module plugins/platforms/discord/exec_approval.py (admin gate, card payload, and view factory on the adapter's shared component base), leaving the >6K-line transport adapter as projection/wiring; the Discord binding regressions moved with it to tests/plugins/platforms/. Authorship lineage: exact-request-binding design credit goes to NousResearch#6105 (first implementation) and NousResearch#87554 (native-adapter carrier incl. the bounded tuple shape adopted here); the broader non-native surfaces rewrite in NousResearch#68080 stays complementary.
19 tasks
This branch has not been deployed
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?
Previously the interactive exec approval adapters reused the session-wide FIFO
/approveresolver too literally. When a session had multiple pending approvals, a button click could resolve the wrong queued request, and some adapters bypassed the gateway's approval authorization check. This change binds each interactive prompt to a stable approval request id and reuses the gateway auth check before resolving the queue entry, so the button UI now matches the request the user actually clicked.Related Issue
Related to #3915 and #503.
Hardens interactive approval integrity in the gateway button flows and also addresses the same general approval-routing/auth concerns seen in #1888.
Type of Change
Changes Made
tools/approval.pyand targetedresolve_gateway_approval(..., request_id=...)supportgateway/run.pyandgateway/platforms/base.pyHow to Test
uv run --with pytest --with pytest-asyncio python -m pytest -o addopts='' tests/gateway/test_approve_deny_commands.py tests/gateway/test_slack_approval_buttons.py tests/gateway/test_telegram_approval_buttons.py tests/gateway/test_feishu_approval_buttons.py -q70 passed)Checklist
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 or workflows — or N/AScreenshots / Logs
N/A