[codex] Bridge Codex app-server approvals to gateway sessions - #27636
[codex] Bridge Codex app-server approvals to gateway sessions#27636rf-openclaw-bot wants to merge 2 commits into
Conversation
|
Thanks for the fix — the premise still holds on current main. Problems
Suggested changes
Automated hermes-sweeper review. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing a real gateway gap. Current main still gives Codex only the terminal-thread callback (agent/codex_runtime.py:346-353), while missing callbacks decline exec/apply-patch requests (agent/transports/codex_app_server_session.py:873-923). The merged bypass-only work in #56534 does not implement manual/smart gateway prompting.
Problems
tools/approval.py:609re-readsHERMES_YOLO_MODEat request time. Current main freezes it at import (tools/approval.py:32-35) and centralizes bypass logic inis_approval_bypass_active()(tools/approval.py:1858-1876) to prevent in-process approval bypass.- The new wait loop duplicates
_await_gateway_decision()but omits its interrupt handling (tools/approval.py:2513-2529), so/stopor/newcan leave a Codex approval blocked until timeout.
Suggested changes
- Salvage the callback bridge onto current main, but route the gateway request through the existing shared approval wait/helper so queue cleanup, hooks, heartbeats, and interrupts remain uniform.
- Use the frozen bypass helper rather than a live environment reread, and add an interrupted-wait regression test.
Automated hermes-sweeper review.
| session_key = get_current_session_key() | ||
| all_keys = list(pattern_keys or [pattern_key]) | ||
|
|
||
| if is_truthy_value(os.getenv("HERMES_YOLO_MODE")) or is_current_session_yolo_enabled(): |
There was a problem hiding this comment.
HERMES_YOLO_MODE is intentionally frozen at import on current main (tools/approval.py:32-35) so an in-process skill cannot enable approval bypass after startup. Please use the canonical frozen bypass path (is_approval_bypass_active() on current main) rather than reading this environment variable during an approval request.
|
I opened #66925 as a current-main, hardened implementation of this gateway approval bridge. It reuses the shared approval queue/wait loop, force-redacts gateway payloads, preserves smart/manual behavior, and applies hardline, sudo-stdin, and user deny policy floors before Codex auto-approval. The focused Codex/approval suites pass with the one documented pre-existing macOS baseline failure excluded. |
Summary
Root cause
Codex app-server approval requests only checked tools.terminal_tool._get_approval_callback(). Gateway sessions register approval notifiers in tools.approval instead, so Telegram/Discord contexts had no callback and failed closed without surfacing a prompt.
Validation