Repository navigation
Compact Responses history and completed tool steps on the server - #1184
Merged
Merged
Conversation
AnthonyRonning
force-pushed
the
codex-resp-compact-maple
branch
2 times, most recently
from
October 22, 2026 07:24
5dba5df to
bba069c
Compare
Preserve selected-model reasoning and native summary output policy, publish reducing complete prefixes, and allow safe terminal/empty history to continue. Protect active images and pending work while preserving the caller output allowance and canonical conversation rows.
AnthonyRonning
force-pushed
the
codex-resp-compact-maple
branch
from
October 26, 2026 05:35
d626cf6 to
27059ea
Compare
AnthonyRonning
marked this pull request as ready for review
October 27, 2026 03:14
This was referenced Oct 27, 2026
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.
Long Responses conversations need server-owned context compaction without discarding canonical history or changing the caller's main output allowance. Add encrypted, source-bound checkpoints behind the default-off
responses_compactionflag, with an isolated legacy-window path for staged rollout and rollback.Resolve existing account/plan/cohort policy once per logical Response and pin it across model selection, image preparation, tools and reactive recovery. Only explicit true selects compaction; disabled/missing/failed lookups select legacy. The scoped flag cache/timeout is 30 seconds/one second; generic flags are unchanged. Client controls cannot bypass the server gate. Archiving disables later admissions after cache expiry; active Responses keep their strategy and deadline.
Compaction normally starts at 80% of available input budget, or a caller-selected threshold. Completed tool exchanges can compact while current input and pending exchanges remain verbatim. Helpers use the selected model through existing attested streaming, usage, cancellation and terminal handling, preserving caller reasoning and native generation allowance. Publication validates source identity and coverage. Incremental summaries, retry suppression and fresh-source fitting checks preserve continuity through failures and model/context recovery.
The final correction keeps the current HTTP/acceptance architecture:
Legacy reads avoid checkpoints/helpers and retain canonical rows/checkpoints across toggles. Batching projects/discards raw image-bearing payloads promptly; 128-row/8-MiB targets do not impose an aggregate transfer/memory cap. The additive checkpoint migration follows normal migration-before-binary release ordering; toggling needs no data conversion.
Metadata-only events cover mode/reason, outcomes, preparation time, helper usage, checkpoint work and legacy source reads. Prompts, summaries, outputs, ciphertext and raw errors are excluded. No Pi, SDK dependency, provider-routing or caller output-limit changes.
Validation at signed parent
27059eae, rebased onto121a1cf4:Draft for review. No merge, hosted flag change or Dev/Production deployment. Hosted edge/model behavior remains a release-validation step.