fix: allow missing native hook relay without policy#88620
fix: allow missing native hook relay without policy#88620woodym-dotcom wants to merge 3 commits into
Conversation
|
Codex review: found issues before merge. Reviewed May 31, 2026, 10:53 AM ET / 14:53 UTC. Summary PR surface: Source +22, Tests +47. Total +69 across 5 files. Reproducibility: yes. from source inspection: current main denies any unavailable PreToolUse relay, and the PR head still does not emit the new marker through the production Codex config path that skips inactive events. 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 findings
Review detailsBest possible solution: Do not merge until the no-policy fallback is either wired through the actual Codex hook config path with tests preserving policy-active fail-closed behavior, or removed in favor of the existing fail-closed semantics. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main denies any unavailable PreToolUse relay, and the PR head still does not emit the new marker through the production Codex config path that skips inactive events. Is this the best way to solve the issue? No. The amended fail-closed default is safer than the first revision, but the marker is attached below a path that production does not call for no-policy PreToolUse, so the proposed implementation is not the narrow complete fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against b334e7ef29ba. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +22, Tests +47. Total +69 across 5 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
|
|
Addressed the review feedback in 26d360b: unavailable PreToolUse now fails closed by default, and the no-policy no-op path only applies when the generated hook command carries an explicit marker from the originating registration. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Added a Real behavior proof section with exact after-fix source CLI output from branch 26d360b. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Updated Real behavior proof with required fields: behavior, environment, steps, evidence, observedResult, notTested. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Updated Real behavior proof to use the exact required field names. @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Real behavior proof gate is now passing for head @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
3b74cd0 to
a70f362
Compare
|
Thanks for the iteration here. Closing this as not planned. The latest head does wire the no-policy marker through the Codex config path, but after maintainer review we do not want to add a new PreToolUse unavailable fallback for the no-policy case without an observed stale generated-command user path. Current behavior already clears PreToolUse from generated Codex config when OpenClaw has no before-tool policy or loop-detection work, and unavailable or unknown PreToolUse relay state should stay fail-closed. Supported path: keep the existing fail-closed fallback, and if we find a real stale-config upgrade/runtime state that blocks basic tool use despite no policy being active, handle that as a targeted migration/doctor/config-clearing fix with a concrete repro. |
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. 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 - pnpm lint --threads=8 - autoreview --mode branch --base origin/main - GitHub CI run 26729700996, Real behavior proof 26729874455, OpenGrep 26729701010, CodeQL high 26729701003 Co-authored-by: woodym-dotcom <[email protected]>
|
Thanks @woodym-dotcom. I landed the final version via #88846 because this fork branch stopped accepting maintainer pushes with Landed commit: fb64546 The landed commit preserves your contributor credit with: Co-authored-by: woodym-dotcom [email protected] For future PRs, please keep "Allow edits by maintainers" enabled; GitHub still reported this PR as maintainer-editable, but the fork rejected both force-with-lease and normal pushes. |
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 openclaw#87543. Replaces openclaw#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 - pnpm lint --threads=8 - autoreview --mode branch --base origin/main - GitHub CI run 26729700996, Real behavior proof 26729874455, OpenGrep 26729701010, CodeQL high 26729701003 Co-authored-by: woodym-dotcom <[email protected]>
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 openclaw#87543. Replaces openclaw#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 - pnpm lint --threads=8 - autoreview --mode branch --base origin/main - GitHub CI run 26729700996, Real behavior proof 26729874455, OpenGrep 26729701010, CodeQL high 26729701003 Co-authored-by: woodym-dotcom <[email protected]>
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 openclaw#87543. Replaces openclaw#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 - pnpm lint --threads=8 - autoreview --mode branch --base origin/main - GitHub CI run 26729700996, Real behavior proof 26729874455, OpenGrep 26729701010, CodeQL high 26729701003 Co-authored-by: woodym-dotcom <[email protected]>
Summary
--pre-tool-use-unavailable noop, for the no-policy PreToolUse case.Review feedback addressed
hasBeforeToolCallPolicy()after relay/gateway failure.Real behavior proof
Behavior or issue addressed: Native hook relay unavailable fallback for Codex hooks after the fix. Explicit no-policy PreToolUse marker returns no-op; missing/unknown PreToolUse state denies; PermissionRequest denies.
Real environment tested: Raspberry Pi local checkout of this PR head
26d360b, Nodev22.22.2, source CLI run withnode --import tsx src/entry.ts, isolated temporaryHOMEandOPENCLAW_HOMEso no user gateway credentials or local OpenClaw config were reused.Exact steps or command run after this patch:
OpenClaw 2026.5.30 (26d360b).hooks relayfor missingpre_tool_usewith--pre-tool-use-unavailable noop.hooks relayfor missingpre_tool_usewithout the marker.hooks relayfor missingpermission_request.Evidence after fix:
Observed result after fix: The amended branch fails closed when PreToolUse policy state is unknown, no-ops only when the generated command carries the explicit no-policy marker, and keeps PermissionRequest denied.
What was not tested: Full local Vitest did not complete in the sparse/partial checkout; GitHub CI is the full test gate. The proof does not exercise a live registered relay because this change is specifically the unavailable-relay fallback path.
Additional validation