Skip to content

fix(tracing): stop marking successful tool calls as errors - #71

Open
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-fix-successful-tools-marked-errors
Open

fix(tracing): stop marking successful tool calls as errors#71
Abhijeet Prasad (AbhiPrasad) wants to merge 1 commit into
mainfrom
abhi-fix-successful-tools-marked-errors

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

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:

{"output":{"message":"Successfully stopped task"},"error":"Successfully stopped task"}

After:

{"output":{"message":"Successfully stopped task"}}

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"}}
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T23:05:44.539570Z 41ef1e4 PR opened
ℹ️ 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: 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".

Comment on lines +1479 to +1480
if let Some(error) = object.get("error").and_then(nonempty_error_text) {
return Some(error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

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.

1 participant