Skip to content

Preserve active additional context across compaction - #61390

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/a3114f387c6a4ae1a2d1651993d0f7a101be7dd5
Nov 13, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Preserve active additional context across compaction

Why

Compaction can drop active client context while deduplication prevents unchanged values from being sent again on subsequent turns.

What changed

Track additional context by history item ID and restore active items when installing complete or prefix compaction results. Preserve their history order, refresh retained items with their original bounded payloads, and leave queued updates to arrive with their input.

Testing

Add regression coverage for local compaction with message context and remote compaction with tool-output context. Verify that current context survives exactly once, stale values are absent, and restored context precedes the preserved user prompt.

## Why

Compaction can drop active client context while deduplication prevents unchanged values from being sent again on subsequent turns.

## What changed

Track additional context by history item ID and restore active items when installing complete or prefix compaction results. Preserve their history order, refresh retained items with their original bounded payloads, and leave queued updates to arrive with their input.

## Testing

Add regression coverage for local compaction with message context and remote compaction with tool-output context. Verify that current context survives exactly once, stale values are absent, and restored context precedes the preserved user prompt.

GitOrigin-RevId: a3114f387c6a4ae1a2d1651993d0f7a101be7dd5
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/a3114f387c6a4ae1a2d1651993d0f7a101be7dd5 branch from bee33a7 to 347143f Compare November 13, 2026 22:19
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-13T22:19:37.048723Z bee33a7 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 347143f into main Nov 13, 2026
12 of 24 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/a3114f387c6a4ae1a2d1651993d0f7a101be7dd5 branch November 13, 2026 22:19
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026
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.

1 participant