feat: add native Codex compaction - #25253
Closed
juanalcasar wants to merge 1 commit into
Closed
Conversation
juanalcasar
marked this pull request as ready for review
May 13, 2026 22:05
Add native /responses/compact support for openai-codex in Codex Responses mode, including encrypted compaction item replay through SessionDB and gateway reload paths. Preserve textual fallback behavior, retain prior Codex checkpoints during fallback, and harden endpoint gating to HTTPS chatgpt.com/backend-api/codex only. Also sanitize Codex compaction metadata before chat-completions providers and preserve compressor api_mode across fallback/restore. Verification: - scripts/run_tests.sh focused surface: 511 passed - python -m compileall on touched files - git diff --check - independent review approved after blocker fixes Note: full suite has unrelated pre-existing/orthogonal failures outside the changed Codex compaction surface.
juanalcasar
force-pushed
the
feat/codex-native-compaction
branch
from
May 13, 2026 22:15
240aabe to
3ed527a
Compare
Author
|
Closing at request of the author. |
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/responses/compactsupport foropenai-codexin Codex Responses mode.compaction_summaryitems through SessionDB/conversation reload paths.https://chatgpt.com/backend-api/codexonly.api_modeacross fallback/restore.Verification
scripts/run_tests.sh tests/agent/test_codex_native_compaction.py tests/run_agent/test_primary_runtime_restore.py tests/agent/transports/test_chat_completions.py tests/agent/test_context_compressor.py tests/agent/test_context_compressor_summary_continuity.py tests/run_agent/test_run_agent_codex_responses.py tests/agent/transports/test_codex_transport.py tests/test_hermes_state.py tests/test_hermes_state_wal_fallback.py— 511 passedpython -m compileall -qon touched Python files — passedgit diff --check— passedhttps://chatgpt.com/backend-api/codex/responses/compact— returnedcompaction_summarywith encrypted contentNotes
storeon/responses/compact; replay still uses the normal Codex Responses path semantics.