feat(codex): preserve prompt cache during history optimization - #225
Draft
alteixeira20 wants to merge 12 commits into
Draft
feat(codex): preserve prompt cache during history optimization#225alteixeira20 wants to merge 12 commits into
alteixeira20 wants to merge 12 commits into
Conversation
alteixeira20
force-pushed
the
upstream-export/05-codex-cache-stable
branch
from
August 12, 2026 07:13
25e2082 to
d77e5d3
Compare
alteixeira20
force-pushed
the
upstream-export/05-codex-cache-stable
branch
from
August 12, 2026 07:36
d77e5d3 to
b26dadf
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.
Problem
Codex benefits from provider-side prompt caching, while modern Responses trajectories can contain completed
function_callandcustom_tool_callrounds.Rebuilding compressed history on every newly-cold turn can mutate an already-warm prefix. Treating custom-tool items as opaque barriers can also fragment history that PXPipe can safely collapse.
A transform that saves raw tokens can therefore still be operationally worse than leaving native Codex history untouched.
Changes
function_callandcustom_tool_callrounds with their outputs bycall_id;thread-id;/responses/compactuntouched.Scope
No Codex launcher/router changes are introduced here; those belong to the preceding draft.
No dashboard redesign, subscription-pricing claim, model promotion, AGY work, or generic OpenAI policy change is included.
Validation
The isolated export is one commit on top of the clean Codex-routing slice.
Fresh exact-head CI passed:
The reviewable contract here is protocol/cache correctness and deterministic behavior; this PR makes no new model-readability claim.
Because this is temporarily stacked against upstream
main, GitHub will initially include changes from its prerequisite PRs in the displayed diff.