fix: preserve no-policy native hook fallback#88846
Conversation
Keep selected no-policy Codex PreToolUse relay hooks installed with an explicit unavailable no-op marker, while unknown unavailable PreToolUse and PermissionRequest still fail closed. Refs #87543. Replaces #88620. Co-authored-by: woodym-dotcom <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 9:05 PM ET / 01:05 UTC. Summary PR surface: Source +26, Tests +86. Total +112 across 7 files. Reproducibility: yes. source-reproducible: current main always denies unavailable PreToolUse, and the replaced proofed branch exercised the missing-relay CLI no-op marker, missing-marker deny, and PermissionRequest deny paths. I did not run tests locally because this review is read-only. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the guarded marker-based fallback after maintainer/security signoff and required CI, while keeping unknown PreToolUse state and PermissionRequest unavailable state fail-closed. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main always denies unavailable PreToolUse, and the replaced proofed branch exercised the missing-relay CLI no-op marker, missing-marker deny, and PermissionRequest deny paths. I did not run tests locally because this review is read-only. Is this the best way to solve the issue? Yes, this appears to be the best fix shape: carrying an explicit generated-command marker is safer than inferring policy state after relay lookup fails, and the unknown/default paths remain fail-closed. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 732748c8c5cb. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +26, Tests +86. Total +112 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Land-ready maintainer replacement for #88620. Work done:
Local verification:
Dependency/Codex contract checked:
GitHub verification:
Known gaps:
|
Summary
Refs #87543.
Replaces #88620.
Verification
pnpm test extensions/codex/src/app-server/native-hook-relay.test.ts src/agents/harness/native-hook-relay.test.ts src/cli/native-hook-relay-cli.test.ts— passed, 3 Vitest shards / 98 tests.pnpm lint --threads=8— passed./Users/steipete/Projects/agent-scripts/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, no accepted/actionable findings.../codex/codex-rs/hooks/src/events/pre_tool_use.rs,../codex/codex-rs/hooks/src/events/permission_request.rs, and../codex/codex-rs/hooks/src/engine/{dispatcher.rs,discovery.rs}.