Files
codex/codex-rs
Dylan Hurd b1387dd6cc Preserve active input context order during compaction (#65128)
## Why

Restoring active context after compaction selects retained messages can
move it across user turns. For example, instructions for a context-only
heartbeat can end up before an earlier, already answered user question.

## What changed

Retain active context in source order when building compacted history
and resetting the context window. Use the full items from live history
so active tool outputs and messages survive prompt shortening.

## Testing

Add regression coverage for a heartbeat that compacts mid-turn, and
verify ordering around repeated user message IDs and pending agent
messages in local and remote compaction.

GitOrigin-RevId: b670f3c4e87331a61986b4c163f892e43bd0261d
2026-12-02 01:08:37 +00:00
..
…
…
…
…