Skip to content

Trace Claude tool permission refusals as denied - #331

Open
Stephen Belanger (Qard) wants to merge 5 commits into
mainfrom
fix/claude-permission-refusals
Open

Stephen Belanger (Qard) wants to merge 5 commits into
mainfrom
fix/claude-permission-refusals

Conversation

@Qard

Copy link
Copy Markdown
Collaborator

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.

@Qard
Stephen Belanger (Qard) marked this pull request as draft November 25, 2026 14:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T18:02:16.711934Z 188b85b Draft marked ready
ℹ️ About Codex in GitHub

Your 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread bt-daemon/src/translate/claude.rs Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude Code permission refusals are traced as "approved" or "cancelled", never "denied"

2 participants