Repository navigation
Trace Claude tool permission refusals as denied - #331
Stephen Belanger (Qard) wants to merge 5 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a354e4510
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 188b85b626
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| "PostToolUseFailure" => { | ||
| let error = tool_failure_text(&event.payload) | ||
| .or_else(|| Some("Tool execution failed".into())); | ||
| let approval = if event.payload.get("error").is_some_and(is_permission_denial) { |
There was a problem hiding this comment.
Decode failure-hook errors through a typed hook schema
The new failure-hook classification reads the known hook envelope with event.payload.get("error"), and the new output fallback in finish_tool repeats that traversal. Root AGENTS.md explicitly prohibits traversing known envelope fields as serde_json::Value and requires decoding them at the input boundary. Model the optional error field in a shared typed hook payload and use it for both denial classification and reason preservation; the error content can retain flexibility where necessary for arbitrary tool results.
AGENTS.md reference: AGENTS.md:L42-L48
Useful? React with 👍 / 👎.
Claude permission refusals could look like approved commands that failed or calls that were cancelled. Live and imported traces now identify known refusal messages as denials and retain the reason.
Fixes #315.
All 40 Claude translator tests pass, including refusals with and without a failure hook.