Skip to content

Preserve MCP tool output as content items - #40737

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/fa1c5b7dee6f003a094265379dcabdd060386a48
Aug 25, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Preserve MCP tool output as content items

What changed

  • Convert unstructured MCP results into typed function-call output items instead of serializing the entire content array as a text string.
  • Keep structured MCP results as serialized text and preserve media, encrypted content, and unknown content through their existing item conversions.
  • Drop empty text items during output truncation so they do not consume API array slots.

Testing

  • Cover text-only, mixed unstructured, structured, and image-sanitized MCP results.
  • Verify empty text items are discarded under byte- and token-based truncation policies.

## What changed

- Convert unstructured MCP results into typed function-call output items instead of serializing the entire content array as a text string.
- Keep structured MCP results as serialized text and preserve media, encrypted content, and unknown content through their existing item conversions.
- Drop empty text items during output truncation so they do not consume API array slots.

## Testing

- Cover text-only, mixed unstructured, structured, and image-sanitized MCP results.
- Verify empty text items are discarded under byte- and token-based truncation policies.

GitOrigin-RevId: fa1c5b7dee6f003a094265379dcabdd060386a48
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/fa1c5b7dee6f003a094265379dcabdd060386a48 branch from 7a2310b to 75cb7c9 Compare August 25, 2026 23:44
@copyberry
copyberry Bot merged commit 75cb7c9 into main Aug 25, 2026
22 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/fa1c5b7dee6f003a094265379dcabdd060386a48 branch August 25, 2026 23:45
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 25, 2026

This branch was previously deployed

1 inactive deployment
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.

2 participants