Skip to content

Preserve more tool metadata within outgoing message budgets - #47758

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/ed00996b77945300f60db1e52eff22b4de2707c1
Sep 24, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Preserve more tool metadata within outgoing message budgets

Why

The 32 KiB per-result cap and 128 KiB aggregate budget discard tool metadata even when the outgoing request has room to retain it.

What changed

  • Remove the per-result capture cap and raise the aggregate executed-tool metadata budget to 2 MiB.
  • Apply a 15 MiB soft budget to serialized HTTP requests and WebSocket messages, using the actual WebSocket delta. Trim optional result metadata on the wire copy while preserving ordinary content and logical history.
  • Prioritize openai/resource_access metadata during trimming, and include overage_bytes in omission markers.
  • Record bytes removed by metadata budgets in codex.tool_metadata.shed_bytes, tagged by stage.

Testing

Add coverage for HTTP and WebSocket message boundaries, resource preservation, residual marker removal, unchanged history, and shedding metrics. Update direct-tool and code-mode tests to verify metadata survives beyond the previous limits.

## Why

The 32 KiB per-result cap and 128 KiB aggregate budget discard tool metadata even when the outgoing request has room to retain it.

## What changed

- Remove the per-result capture cap and raise the aggregate executed-tool metadata budget to 2 MiB.
- Apply a 15 MiB soft budget to serialized HTTP requests and WebSocket messages, using the actual WebSocket delta. Trim optional result metadata on the wire copy while preserving ordinary content and logical history.
- Prioritize `openai/resource_access` metadata during trimming, and include `overage_bytes` in omission markers.
- Record bytes removed by metadata budgets in `codex.tool_metadata.shed_bytes`, tagged by stage.

## Testing

Add coverage for HTTP and WebSocket message boundaries, resource preservation, residual marker removal, unchanged history, and shedding metrics. Update direct-tool and code-mode tests to verify metadata survives beyond the previous limits.

GitOrigin-RevId: ed00996b77945300f60db1e52eff22b4de2707c1
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/ed00996b77945300f60db1e52eff22b4de2707c1 branch from a775a38 to 53446f9 Compare September 24, 2026 05:48
@copyberry
copyberry Bot merged commit 53446f9 into main Sep 24, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/ed00996b77945300f60db1e52eff22b4de2707c1 branch September 24, 2026 05:49
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
@laat
laat deployed to issue-triage September 24, 2026 06:21 — with GitHub Actions Active
@laat
laat deployed to issue-triage September 24, 2026 06:21 — with GitHub Actions Active
@laat
laat deployed to issue-triage September 24, 2026 06:21 — with GitHub Actions Active
@laat
laat deployed to issue-triage September 24, 2026 06:22 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:28 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:28 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:28 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:29 — with GitHub Actions Active
@czaraf
czaraf deployed to issue-triage September 24, 2026 06:34 — with GitHub Actions Active
@czaraf
czaraf deployed to issue-triage September 24, 2026 06:34 — with GitHub Actions Active
@czaraf
czaraf deployed to issue-triage September 24, 2026 06:34 — with GitHub Actions Active
@czaraf
czaraf deployed to issue-triage September 24, 2026 06:35 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:44 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:44 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:44 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:47 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:47 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:47 — with GitHub Actions Active
@joshka
joshka deployed to issue-triage September 24, 2026 06:48 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:49 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:49 — with GitHub Actions Active
@PhDuy2005
PhDuy2005 deployed to issue-triage September 24, 2026 06:49 — with GitHub Actions Active

This branch was successfully deployed

1 active 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.