mirror of
https://github.com/openai/codex.git
synced 2026-10-23 18:08:45 +00:00
## Why Model output alone does not establish that an item entered conversation history. Treating every response item as accepted can include discarded attempts, while relying on a later request misses accepted final output when a turn ends or is interrupted. ## What changed - Record `HistoryItemAccepted` events and retain Responses item IDs, generating missing IDs consistently across item events. - Build thread conversation history from request inputs, compaction checkpoints, and explicit acceptance. Keep unaccepted output accessible through its inference call. - Preserve inference provenance across retries and late response records without overwriting newer request or compaction snapshots. - Mark turns with errors as failed. Bump trace schemas to version 2 and reject incompatible bundles and event schemas during replay. ## Testing Add reducer coverage for discarded attempts with identical text, late responses, compaction, inherited context, and legacy bundle rejection. Add CLI integration tests that run `debug trace-reduce` after success, stream failure, and interruption followed by shutdown, including responses without provider item IDs. GitOrigin-RevId: 8e387a91d9b3f704df82847d630e6f0b08f998b3