Repository navigation
fix(pabcd-state): send PreToolUse advisories as context only - #333
Merged
Merged
Conversation
- drop permissionDecision allow from the idle-edit, shell-subst and friction advisories, which codex rejects without updatedInput and then discards - move the friction advice from permissionDecisionReason into additionalContext - assert the context-only envelope in the unit and hook e2e tests
lidge-jun
added a commit
that referenced
this pull request
Oct 31, 2026
…notes docs(pabcd-state): clarify #333 advisory notes
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three PreToolUse advisories never reach the model. Codex rejects their envelope and logs
PreToolUse hook returned unsupported permissionDecision:allowon every matching tool call, so the IDLE-EDIT reminder, the SHELL-SUBST-01 advisory and the friction warning are dropped while the user sees a hook failure.Cause
Codex accepts
permissionDecision: "allow"from a PreToolUse hook only together withupdatedInput(output_parser.rsunsupported_pre_tool_use_hook_specific_output). Anything else setsinvalid_reason, and pre_tool_use.rs then marks the run failed and keeps the hook'sadditionalContextout of the model's input. ApermissionDecisionReasonsent without a decision is rejected the same way.idle-edit.ts(IDLE-EDIT advisory)allow+additionalContextadditionalContextgit-write-guard.tsadvise branch (SHELL-SUBST-01)allow+additionalContextadditionalContextfriction-gate.tsallow+permissionDecisionReasonadditionalContextThe tool call still runs in every case. Deny envelopes are unchanged, and
spawn-attach-hook.tskeeps itsallow, which carriesupdatedInput.Validation
echo "\x`"piped tonode plugins/codexclaw/components/pabcd-state/dist/cli.js hook worktree-guard-pretool:dev00a481f5 returns{"permissionDecision":"allow","additionalContext":"[codexclaw: SHELL-SUBST-01 advisory] ..."}, this branch returns{"additionalContext":"[codexclaw: SHELL-SUBST-01 advisory] ..."}`.idle-edit.test.tsandgit-write-guard.test.tsfail against the old source (2 failures) and pass with the fix; those two files plushook-e2e.test.mjs(L080 now asserts the friction advice inadditionalContext): 49 pass, 0 fail.npm run buildregenerated the threedist/files;node plugins/codexclaw/scripts/gate.mjs: OK.npm teston Windows: the same failures ondevand on this branch (Windows path,cxc mapand visualize tests).timeout yields staleModel nullinsubagent-config/test/mcp.test.tsfailed once on the branch and passed 3 of 3 alone.Limits
No hook declaration changed, so installed hooks keep their trust. I did not drive a full Codex session through the hook; the Codex behavior above is read from its source at the linked commit.