fix(gateway): forward approval denial reason - #70226
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused regression coverage. The underlying propagation bug is still present on current main: tui_gateway/methods_prompt.py:875-879 forwards choice and resolve_all but not reason, while tools/approval.py:2198-2230 accepts and stores the reason for the blocked-action feedback path.
Problems
- The production hunk now targets a stale location. Commit
f67ca220ab5ba1f2a764b84b9c8db7d003a042f6moved theapproval.respondhandler fromtui_gateway/server.pytotui_gateway/methods_prompt.py; current dispatch installs that module intui_gateway/server.py:13292-13306.
Suggested changes
- Salvage the one-line forwarding change into
tui_gateway/methods_prompt.py:875-879. The addedserver.handle_requestregression test remains the appropriate boundary-level coverage after resolving its placement conflict.
Automated hermes-sweeper review.
| @@ -11919,6 +11919,7 @@ def _(rid, params: dict) -> dict: | |||
| "resolved": resolve_gateway_approval( | |||
There was a problem hiding this comment.
This is the right forwarding change, but current main moved the approval.respond handler to tui_gateway/methods_prompt.py:864-883 in f67ca220ab. Please apply this line at that live call site during salvage; this former server.py location is no longer the active handler.
There was a problem hiding this comment.
Addressed in 1226bd3. I rebased the branch onto current main (c55159f), dropped the stale server.py hunk, and applied the one-line reason forwarding at the live tui_gateway/methods_prompt.py handler. The existing server.handle_request boundary test was preserved and reproduced RED on current main before the fix, then GREEN after it. The focused gateway/protocol/approval matrix is 636 passed; Ruff and git diff --check are clean. The one excluded macOS /tmp assertion fails identically on an unchanged c55159f worktree. Thanks for the precise salvage pointer.
8028d32 to
1226bd3
Compare
Problem
approval.respondaccepted a denialreasonat the desktop/gateway RPC boundary but silently dropped it before calling the existing approval resolver. Any UI that collected a denial explanation therefore appeared to work while the backend never received the text.Premise and root cause
The lower-level
resolve_gateway_approval()contract already supports an optionalreason. The live gateway handler forwardedsession_key,choice, andresolve_all, but omittedparams["reason"]. This is a boundary propagation bug, not a new approval feature.During review, upstream commit
f67ca220abhad moved the activeapproval.respondhandler fromtui_gateway/server.pytotui_gateway/methods_prompt.py. The branch is now rebased onto currentmainand the one-line fix is applied only at that live call site.Changes
reasonfromapproval.respondtoresolve_gateway_approval()intui_gateway/methods_prompt.py.server.handle_requestregression test, which proveschoice,reason, andresolve_allarrive together through the registered split-module handler.None).Before / after
Validation
RED on current main
HERMES_TEST_FILE_RETRIES=0 scripts/run_tests.sh \ tests/test_tui_gateway_server.py \ -k test_approval_respond_forwards_reason_and_optional_resolve_all -q # 1 failed: actual resolver call omitted reasonGREEN
The excluded verification-artifact cleanup case is an unrelated existing macOS
/tmppath assertion. It was rerun in a detached worktree at unchanged current basec55159f18and failed identically there.Scope receipt
origin/main(c55159f18)Non-goals
Tracks s-a-s-k-i-a#3
Part of s-a-s-k-i-a#1
Replaces the first narrow prerequisite extracted from #70156.