fix(approval): drop dead eager redaction unblocking CI on live-config - #120
fix(approval): drop dead eager redaction unblocking CI on live-config#120exiao wants to merge 1 commit into
Conversation
check_execute_code_guard redacted three display_* copies with _redact_for_approval (force=False) at the top of the approval path, before the smart-approval observer's two force=True calls. That made the redaction sequence [False,False,False,True,True] instead of the expected [True,True], failing test_smart_observer_redaction_is_forced_when_config_disables_redaction and blocking every open PR into live-config. The eager block was dead: all three display_* names are unconditionally reassigned lower down (past the early-return gates) before first use. Remove it so the execute-code path matches check_all_command_guards, which already redacts for display only after the smart branch. Display/redaction behavior is unchanged. Patch note: ~/.hermes/plans/hermes-patches/execute-code-guard-eager-redact.md
There was a problem hiding this comment.
Code Review
This pull request removes the redaction logic for display commands, code, and descriptions within the check_execute_code_guard function in tools/approval.py. I have no feedback to provide as there are no review comments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Claude finished @exiao's task in 1m 10s —— View job Review: drop dead eager redaction in
|
There was a problem hiding this comment.
LGTM — verified the deleted eager-redact block in check_execute_code_guard is provably dead: the three display_* names have no read between the deletion point and their unconditional reassignment at approval.py:3653-3655, so removal is behavior-preserving for display output and only drops three unforced redact calls that ran ahead of the smart-approval observer, aligning the force sequence with check_all_command_guards. No prompt-cache, role-alternation, or footprint impact. 0 blocking.
Problem
CI is red on
live-config, blocking every open PR (#118, #119). The failure:Order-independent (fails in isolation), so it's a real base-branch bug, not flake. Introduced by the upstream merge (#117).
Root cause
check_execute_code_guardredacted three display copies eagerly at the top of the approval path:_redact_for_approvalcallsredact_sensitive_text(text)with the defaultforce=False. Those three unforced calls run before the smart-approval observer, which then makes its twoforce=Truecalls →[False,False,False,True,True].The eager block is dead: all three
display_*names are unconditionally reassigned lower down (display_command = redact_sensitive_text(command)…) before their first use, past the early-return gates. The siblingcheck_all_command_guardsalready redacts for display only after the smart branch, which is why only the execute-code parametrization failed.Fix
Delete the dead eager-redact block (10 lines, including its duplicated comment; the identical comment survives on the real assignment block). Display/redaction behavior is unchanged: the copies are still produced identically at their real assignment site. The only observable effect is the redaction call sequence now matches the command-guard path.
Verification
tests/tools/test_approval_plugin_hooks.py→ 21 passed (was 1 failed).TestDetectDangerousRmrm-detection,prompt_toolkitmissing-module, YAML-off) reproduce on unmodifiedlive-configor are cross-test pollution — unrelated to this one-file diff.Patch note:
~/.hermes/plans/hermes-patches/execute-code-guard-eager-redact.md