Run compact hooks for remote compaction v2#22828
Merged
Merged
Conversation
Collaborator
Author
|
@codex review |
Contributor
|
Codex Review: Didn't find any major issues. Delightful! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
Remote compaction v2 is the
/responsesimplementation of session-history compaction, but it still needs to preserve the observable contract of the legacy/responses/compactpath. In particular, users and integrations that rely onPreCompactandPostCompacthooks should not see different behavior whenremote_compaction_v2is enabled.What Changed
PreCompactbefore issuing the remote compaction v2 request, includingInterruptedanalytics when a pre-hook stops execution.PostCompactafter a successful v2 compaction and aborts the turn if the post-hook stops execution.compact_remote_paritycoverage that compares legacy and v2 compaction across manual transcript shapes, automatic pre-turn compaction, automatic mid-turn compaction, hook payloads, replacement history, follow-up request payloads, and API-keyservice_tier=fastbehavior.core/tests/suite.Relevant code:
compact_remote_v2.rscompact_remote_parity.rsVerification
core/tests/suite/compact_remote_parity.rsto assert parity between legacy remote compaction and remote compaction v2 for the affected request, hook, rollout-history, and follow-up paths.compact_remote_v2unit coverage still exercises v2 replacement-history retention and compaction-output collection.