Repository navigation
feat(server): opt in to compaction before PR waits - #16855
Closed
MartinPTielemans wants to merge 3 commits into
Closed
MartinPTielemans wants to merge 3 commits into
MartinPTielemans wants to merge 3 commits into
Conversation
Allow every provider with native compaction, mark the queued turn by id, skip it instead of holding the queue when input arrives, and trim the tool and user docs.
A provider without native compaction now fails that message as a validation error, so the queue keeps delivering PR wakes behind it. Pending input only drops the watch's compaction while it is still an unedited /compact.
2 tasks done
Member
|
Note This comment is posted by Julius' dot This adds a new workflow that queues compaction when starting a PR watch. The description and your follow-up in #13988 say direction approval is still pending; that issue's warm-cache offer discussion does not approve this watch-triggered workflow. Closing under the prior-approval requirement. Please get explicit maintainer approval for this scope and link it when requesting reconsideration. |
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
A large conversation that waits on PR news can wake with a cold provider prompt cache and reread its whole history (#16829, #13988).
Change
watch_pull_requestgets an opt-incompactBeforeWaitingflag. Starting a new watch with it queues one native/compactturn after the current turn, or starts it right away on an idle conversation. The watch and the request commit together, and PR news that arrives in the meantime queues behind the compaction. Ordinary watches don't change, and a repeat call on an existing watch doesn't queue a second compaction.Any provider with native compaction works. The request is rejected if the thread already has queued work, pending input or approval, unfinished maintenance, or an unsafe run state. In that case the agent is told to watch without compaction. If a question or approval arrives after opt-in, the queued compaction is dropped so the answer runs next. The user can cancel the queued compaction like any queued message.
This is a direction proposal and needs maintainer sign-off. Keepalives, budgets, and cache-TTL telemetry are out of scope.
Verification
vp test runonPullRequestWatchCompaction.test.ts, the pull-request toolkithandlers.test.ts,pullRequestWatch.test.ts, andThreadStop.test.ts: 60 passed.Model: Claude Opus 5.5 · Harness: Claude Code in T3 Code