Skip to content

Preserve incomplete response output in failed inference traces - #58456

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/594f6a37a5af543694f19fcffe0c164cb2addb36
Oct 30, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/594f6a37a5af543694f19fcffe0c164cb2addb36

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Preserve incomplete response output in failed inference traces

Why

When a response fails with incomplete output, attempted tool calls can appear only in the terminal response payload. Failed inference traces previously omitted those items, losing evidence of the attempted call.

What changed

Retain output items marked incomplete on ResponseIncompleteError and include recognized items in failed inference traces, deduplicating by item ID. Keep these items out of streamed output, tool dispatch, and the continuation cache, and omit their payloads from the error's debug representation.

Testing

Add tests for retaining only incomplete output from terminal responses and recording attempted calls in failed traces without streaming them or creating tool calls. Cover unknown response item types being skipped.

## Why

When a response fails with incomplete output, attempted tool calls can appear only in the terminal response payload. Failed inference traces previously omitted those items, losing evidence of the attempted call.

## What changed

Retain output items marked `incomplete` on `ResponseIncompleteError` and include recognized items in failed inference traces, deduplicating by item ID. Keep these items out of streamed output, tool dispatch, and the continuation cache, and omit their payloads from the error's debug representation.

## Testing

Add tests for retaining only incomplete output from terminal responses and recording attempted calls in failed traces without streaming them or creating tool calls. Cover unknown response item types being skipped.

GitOrigin-RevId: 594f6a37a5af543694f19fcffe0c164cb2addb36
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/594f6a37a5af543694f19fcffe0c164cb2addb36 branch from 0c185f1 to 7656a23 Compare October 30, 2026 23:55
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-30T23:55:57.897826Z 0c185f1 PR opened
ℹ️ 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 review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot merged commit 7656a23 into main Oct 30, 2026
22 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/594f6a37a5af543694f19fcffe0c164cb2addb36 branch October 30, 2026 23:56
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant