Skip to content

Retain client-marked tool outputs across compaction - #52937

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/449179670e4d2be2623928700738758e43b5dc1a
Oct 10, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Retain client-marked tool outputs across compaction

Why

Client-supplied tool outputs can carry task instructions. Even when marked with retain: true, these instructions could be trimmed before compaction and disappear from the compacted history.

What changed

Add the disabled-by-default retain_client_tool_outputs feature to honor retention for explicitly marked, named function_call_output items without a call_id.

  • Preserve eligible outputs in remote compaction v2 and when starting a new context window, keeping their original role.
  • Stop emergency tool-output trimming at a retained output.
  • Share the existing 64,000-token retention budget, keeping outputs whole and dropping an oversized output and older items rather than partially truncating it.
  • Place initial context before retained standalone outputs and account for their images in retained-image counts.

Testing

Add a scenario covering enabled and disabled retention, emergency trimming, oversized-output handling, and preservation of the latest instruction after compaction and cold resume. Verify that retention annotations stay out of model requests.

## Why

Client-supplied tool outputs can carry task instructions. Even when marked with `retain: true`, these instructions could be trimmed before compaction and disappear from the compacted history.

## What changed

Add the disabled-by-default `retain_client_tool_outputs` feature to honor retention for explicitly marked, named `function_call_output` items without a `call_id`.

- Preserve eligible outputs in remote compaction v2 and when starting a new context window, keeping their original role.
- Stop emergency tool-output trimming at a retained output.
- Share the existing 64,000-token retention budget, keeping outputs whole and dropping an oversized output and older items rather than partially truncating it.
- Place initial context before retained standalone outputs and account for their images in retained-image counts.

## Testing

Add a scenario covering enabled and disabled retention, emergency trimming, oversized-output handling, and preservation of the latest instruction after compaction and cold resume. Verify that retention annotations stay out of model requests.

GitOrigin-RevId: 449179670e4d2be2623928700738758e43b5dc1a
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/449179670e4d2be2623928700738758e43b5dc1a branch from a62d610 to 6c0c675 Compare October 10, 2026 17:30
@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-10T17:30:37.185958Z a62d610 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 6c0c675 into main Oct 10, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/449179670e4d2be2623928700738758e43b5dc1a branch October 10, 2026 17:30
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 10, 2026
@jay-tau
jay-tau deployed to issue-triage October 10, 2026 17:34 — with Image GitHub Actions Active
@jay-tau
jay-tau deployed to issue-triage October 10, 2026 17:34 — with Image GitHub Actions Active
@jay-tau
jay-tau deployed to issue-triage October 10, 2026 17:34 — with Image GitHub Actions Active
@FxNion
FxNion deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@FxNion
FxNion deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@FxNion
FxNion deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@melinerunen
melinerunen deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@melinerunen
melinerunen deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@melinerunen
melinerunen deployed to issue-triage October 10, 2026 17:46 — with Image GitHub Actions Active
@melinerunen
melinerunen deployed to issue-triage October 10, 2026 17:47 — with Image GitHub Actions Active
@FxNion
FxNion deployed to issue-triage October 10, 2026 17:47 — with Image GitHub Actions Active
@suzyac5318
suzyac5318 deployed to issue-triage October 10, 2026 17:49 — with Image GitHub Actions Active
@suzyac5318
suzyac5318 deployed to issue-triage October 10, 2026 17:49 — with Image GitHub Actions Active
@suzyac5318
suzyac5318 deployed to issue-triage October 10, 2026 17:49 — with Image GitHub Actions Active
@Kietnehi
Kietnehi deployed to issue-triage October 10, 2026 17:50 — with Image GitHub Actions Active
@Kietnehi
Kietnehi deployed to issue-triage October 10, 2026 17:50 — with Image GitHub Actions Active
@Kietnehi
Kietnehi deployed to issue-triage October 10, 2026 17:50 — with Image GitHub Actions Active
@suzyac5318
suzyac5318 deployed to issue-triage October 10, 2026 17:50 — with Image GitHub Actions Active
@hj-smith
hj-smith deployed to issue-triage October 10, 2026 17:58 — with Image GitHub Actions Active
@hj-smith
hj-smith deployed to issue-triage October 10, 2026 17:58 — with Image GitHub Actions Active
@hj-smith
hj-smith deployed to issue-triage October 10, 2026 17:58 — with Image GitHub Actions Active
@hj-smith
hj-smith deployed to issue-triage October 10, 2026 17:59 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
issue-triage — 6c0c6759 Deployed Oct 10, 2026 by hj-smith via Identify potential duplicates (open issues fallback) #54179
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.

9 participants