fix(tracing): stop marking successful tool calls as errors - #71
fix(tracing): stop marking successful tool calls as errors#71Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
Conversation
Claude treated Bash stderr and TaskStop success messages as failure diagnostics.
Require a native failure signal before setting `error`, and ignore empty error
members in structured Codex output.
Before:
{"output":{"message":"Successfully stopped task"},"error":"Successfully stopped task"}
After:
{"output":{"message":"Successfully stopped task"}}
Codex Review SummaryThis 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: 41ef1e401f
ℹ️ 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".
| if let Some(error) = object.get("error").and_then(nonempty_error_text) { | ||
| return Some(error); |
There was a problem hiding this comment.
Preserve non-text explicit Codex errors
When a structured function-call output uses a non-text error marker such as {"error": true}, nonempty_error_text returns None, so this branch records the tool as successful. Before this change, the presence of any error member produced the fallback error; while null, false, and blank strings should be ignored, truthy or otherwise nonempty error values must still classify the call as failed and use the fallback when no message can be extracted.
Useful? React with 👍 / 👎.
resolves https://linear.app/braintrustdata/issue/SDK-344/successful-tool-calls-populate-the-error-field
We were always recording an error for claude code, which is wrong. While we here, ignore empty error members in structured Codex output.
Before:
After: