Skip to content

Preserve user text parts during local compaction - #48115

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/39d9df9ae5360506c2a4bdeac76d89198dbbd39c
Sep 25, 2026
Merged

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

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Preserve user text parts during local compaction

Why

Local compaction flattened retained user messages into a single text part, losing their original content boundaries and per-part annotations.

What changed

Preserve the original content parts and annotations for text-only user messages that fit within the token budget. Borrow the original messages until selected history entries are materialized, and rebuild only the text fallback for truncated messages or messages containing media.

Testing

Extend unit coverage for text boundaries, empty parts, omitted media, and retained metadata. Update the compaction integration test to verify that a multipart user message survives unchanged in the next request and retains its content parts and annotations in persisted replacement history.

## Why

Local compaction flattened retained user messages into a single text part, losing their original content boundaries and per-part annotations.

## What changed

Preserve the original content parts and annotations for text-only user messages that fit within the token budget. Borrow the original messages until selected history entries are materialized, and rebuild only the text fallback for truncated messages or messages containing media.

## Testing

Extend unit coverage for text boundaries, empty parts, omitted media, and retained metadata. Update the compaction integration test to verify that a multipart user message survives unchanged in the next request and retains its content parts and annotations in persisted replacement history.

GitOrigin-RevId: 39d9df9ae5360506c2a4bdeac76d89198dbbd39c
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/39d9df9ae5360506c2a4bdeac76d89198dbbd39c branch from d7c3d67 to bd3d4d1 Compare September 25, 2026 15:03
@copyberry
copyberry Bot merged commit bd3d4d1 into main Sep 25, 2026
15 of 20 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/39d9df9ae5360506c2a4bdeac76d89198dbbd39c branch September 25, 2026 15:03
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 25, 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