Skip to content

Share byte buffers across exec-server output chunks - #49972

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6bba114af48424aa844487aa75163cfc604e0575
Oct 1, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Share byte buffers across exec-server output chunks

Why

Retaining process output, publishing events, and serving reads cloned the underlying byte buffers. Sharing those buffers avoids copying output bytes when chunks are cloned.

What changed

Store ByteChunk bytes in Arc<Vec<u8>> and retain ProcessOutputChunk values directly. Add borrowed byte access for the MCP process transport while preserving base64 serialization and owned byte extraction through into_inner().

Testing

Add a unit test covering base64 serialization, deserialization, and independent owned bytes extracted from shared chunks.

## Why

Retaining process output, publishing events, and serving reads cloned the underlying byte buffers. Sharing those buffers avoids copying output bytes when chunks are cloned.

## What changed

Store `ByteChunk` bytes in `Arc<Vec<u8>>` and retain `ProcessOutputChunk` values directly. Add borrowed byte access for the MCP process transport while preserving base64 serialization and owned byte extraction through `into_inner()`.

## Testing

Add a unit test covering base64 serialization, deserialization, and independent owned bytes extracted from shared chunks.

GitOrigin-RevId: 6bba114af48424aa844487aa75163cfc604e0575
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6bba114af48424aa844487aa75163cfc604e0575 branch from 4541fde to a933dd7 Compare October 1, 2026 12:41
@copyberry
copyberry Bot merged commit a933dd7 into main Oct 1, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6bba114af48424aa844487aa75163cfc604e0575 branch October 1, 2026 12:41
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 1, 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.