Skip to content

Install full context in compaction replacement history - #51117

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/8572a76c31c6884a3c580b3bbb350d49af876bd1
Oct 5, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Install full context in compaction replacement history

Why

Manual, pre-turn, and post-turn compaction previously deferred rebuilding initial context until the next turn. Their saved replacement history could omit refreshed instructions and skill catalogs.

What changed

  • Install initial context during local and remote compaction, before the last real user message or summary, keeping the compaction summary last.
  • Persist matching full world-state and turn-context baselines with every replacement instead of retaining only partial extension metadata.
  • Build replacement context and recompute token usage for the current model even when the previous model performs compaction. Reuse that captured context for eligible current-model retries.
  • Capture manual compaction context centrally and propagate preparation errors to the task runner.

Testing

Update assertions and snapshots for context ordering, refreshed instructions, resume and fork history, current-model checkpoint baselines, and cloud skill catalog retention across compaction and resume.

## Why

Manual, pre-turn, and post-turn compaction previously deferred rebuilding initial context until the next turn. Their saved replacement history could omit refreshed instructions and skill catalogs.

## What changed

- Install initial context during local and remote compaction, before the last real user message or summary, keeping the compaction summary last.
- Persist matching full world-state and turn-context baselines with every replacement instead of retaining only partial extension metadata.
- Build replacement context and recompute token usage for the current model even when the previous model performs compaction. Reuse that captured context for eligible current-model retries.
- Capture manual compaction context centrally and propagate preparation errors to the task runner.

## Testing

Update assertions and snapshots for context ordering, refreshed instructions, resume and fork history, current-model checkpoint baselines, and cloud skill catalog retention across compaction and resume.

GitOrigin-RevId: 8572a76c31c6884a3c580b3bbb350d49af876bd1
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/8572a76c31c6884a3c580b3bbb350d49af876bd1 branch from 2bf419a to 8571b9e Compare October 5, 2026 16:10
@copyberry
copyberry Bot merged commit 8571b9e into main Oct 5, 2026
6 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/8572a76c31c6884a3c580b3bbb350d49af876bd1 branch October 5, 2026 16:10
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 5, 2026

This branch was previously deployed

1 inactive deployment
issue-triage — 8571b9ea Deployed Oct 5, 2026 by Chris-Duke via Generate label suggestions #52000
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