feat(agent): add provider-native Codex compaction - #733
Open
paralin wants to merge 1 commit into
Open
Conversation
paralin
force-pushed
the
feat/codex-native-compaction
branch
from
August 6, 2026 12:19
ef40999 to
b4383d7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b4383d7. Configure here.
paralin
force-pushed
the
feat/codex-native-compaction
branch
from
August 6, 2026 17:33
b4383d7 to
00ced4e
Compare
Author
|
All findings addressed. |
paralin
force-pushed
the
feat/codex-native-compaction
branch
from
August 6, 2026 22:07
00ced4e to
6f9fab5
Compare
zhengr
pushed a commit
to zhengr/prime-agent
that referenced
this pull request
Aug 8, 2026
- Add OpenAI Codex official support entry - Add pi-internal:// URL scheme - Add ctx.shutdown() fix (PrimeIntellect-ai#756) - Add OpenAI Codex retry logic (PrimeIntellect-ai#733) - Add third-party contributions: - PrimeIntellect-ai#702 by @aliou (custom tool HTML export) - PrimeIntellect-ai#728 by @richardgill (frontmatter parsing, SelectList fix) - PrimeIntellect-ai#747 by @kaofelix (tree filter shortcuts) - PrimeIntellect-ai#752 by @richardgill (keymap expansion)
paralin
force-pushed
the
feat/codex-native-compaction
branch
from
August 12, 2026 22:30
6f9fab5 to
b62e26b
Compare
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.

Use provider-native OpenAI Codex compaction instead of always producing a local plaintext summary.
The provider API exposes optional native compaction. Codex uses the normal V2 Responses stream with the compaction method and falls back to the legacy compact endpoint when required. Requests reuse the existing conversion, authentication, account, session, compatibility, and custom-header handling, and are cancellable and bounded.
The coding agent persists provider-tagged opaque replacement history in its append-only session journal, replays it only for the matching provider, and restores the newest compatible portable boundary when models change or native compaction fails. Manual, automatic, and overflow compaction use the same native-first policy; unsupported providers and explicit opt-out continue using the local summarizer.
The branch includes the fixes from prior review for active-model replay guards, compaction entry identity, active-turn model switching, the placeholder assertion, and portable-boundary fallback.
Validation: 126 focused tests passed, 2 skipped;
npm run checkpassed.Note
Add provider-native compaction for OpenAI Codex with fallback to local summarization
compactNativefunction that calls a provider-registeredcompactcapability (viacompactOpenAICodexResponses) using the Codex V2 SSE endpoint, falling back to the V1/compactendpoint on failure.replacementHistorythat is stored inCompactionEntry.providerNativeCompactionand replayed verbatim into subsequent Responses API requests viaproviderPayloadon user messages.buildSessionContextis now provider-aware: it selects the most recent compatible compaction boundary and, when a native result is present, injects it as anopenaiResponsesHistorypayload instead of a text summary.setModel,cycleAvailableModels, etc.) triggers a provider-aware message rebuild; during active streaming, this rebuild is deferred until streaming and queued events quiesce.compaction.nativesetting (defaulttrue) controls preference for native compaction; setting it tofalseforces local LLM-based summarization.Macroscope summarized b62e26b.