Propagate cache key and service tiers in compact#21249
Merged
aibrahim-oai merged 15 commits intomainfrom May 6, 2026
Merged
Conversation
Add service_tier and prompt_cache_key to the compact endpoint input by reusing the responses request builder output for remote compaction. Add request-body diff snapshot coverage for API-key and ChatGPT auth so prompt cache key parity and ChatGPT service tier propagation stay pinned. Co-authored-by: Codex <[email protected]>
Drive the compact request parity coverage through five varied turns, including multi-part text, tool output, image input, local shell output, and final-turn reasoning. Update the request-body diff snapshots so prompt_cache_key and ChatGPT service_tier parity are checked after a realistic history shape. Co-authored-by: Codex <[email protected]>
Only propagate service_tier into /responses/compact when the active auth is ChatGPT-backed. Keep prompt_cache_key on compact requests for all auth modes, and update the API-key parity snapshot to prove service_tier is omitted even when the session has Fast configured. Co-authored-by: Codex <[email protected]>
Group compact request controls behind a named settings value so the compact client call stays below the argument-count lint while preserving the ChatGPT-only service tier gate. Co-authored-by: Codex <[email protected]>
Narrow the compact request helper to crate visibility and remove duplicate TUI fixture fields introduced by the main merge. Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
jif-oai
approved these changes
May 6, 2026
Collaborator
jif-oai
left a comment
There was a problem hiding this comment.
lgtm but the test harness look super heavy and not sure of the value it brings
| ContextSnapshotRenderMode::FullText => { | ||
| normalize_snapshot_uuids(&normalize_snapshot_line_endings(text)) | ||
| } | ||
| ContextSnapshotRenderMode::KindOnly => unreachable!(), |
Collaborator
There was a problem hiding this comment.
I feel those are usually not good practice as they don't contain a lot of debug info. But ok for tests I guess
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
/responses/compactshould preserve the request-affinity fields that apply to the active auth mode. ChatGPT-auth compact requests need the effectiveservice_tier, and compact requests for every auth mode need the stableprompt_cache_key, so compaction does not quietly lose routing or cache behavior that normal sampling already has.This follows the request-parity direction from #20719, but keeps the net change focused on the compact payload fields needed here.
What changed
service_tierandprompt_cache_keyto the compact endpoint input payload.Faststill maps toprioritywhen compact sends a service tier.prompt_cache_keyon compact payloads for all auth modes.core/tests/suite/compact_remote.rsfor:prompt_cache_keywhile omittingservice_tiereven whenFastis configured.service_tierandprompt_cache_key.Verification
/responsesrequest after five varied turns.