Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
The change looks good. I ran the plugin's tests on the base and on this branch. On the base, the four new archive tests fail: archived sessions keep warming, or get warming scheduled again when prompted. With this change all 21 tests pass, and typecheck:tsc passes.
Archiving or deleting a session now removes its warming loop straight away. Archiving doesn't clear the session's request-in-progress marker, but that's harmless: the loop waiting on it has already been removed, and the request's end event still clears it.
Public API: unchanged. The plugin only subscribes to the existing session.archived event.
No blocking concerns.
Related: #58163
3 of 6 tasks
This branch has not been deployed
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.
Issue for this PR
Fixes #65180
Type of change
What does this PR do?
Stops prompt-cache warming when a session is archived and avoids scheduling warming for sessions that are already archived.
WarmingPlugin(packages/core/src/plugin/warming.ts) tosession.archived, clearingoutlivedand removing the session's warming loop viaFiberMap.removeright away.session.time.archivedin thecontext,compaction, andgeneratehooks before scheduling warming (and removes any existing loop if the session is already archived), so prompting an archived session does not re-arm warming.session.unarchivedunsubscribed so unarchiving does not auto-start warming; a later normal request schedules warming again naturally.session.deletedcleanup so the warming loop is removed before resolving any pendingrunningdeferred.services/site/src/docs/content/warming.mdx.How did you verify your code works?
packages/core/test/plugin/warming.test.tscovering archiving a warmed session, archiving while a request is running, prompting an archived session (context,compaction,generate), and unarchiving followed by a normal request.bun run script/test.ts test/plugin/warming.test.ts test/config/warming.test.ts --rerun-each 10 --randomizeinpackages/core(230/230 passed).bun typecheckandbun run typecheck:tscinpackages/core,bun run checkfrom repo root, andbun run buildinservices/site.Screenshots / recordings
N/A (no UI changes).
Checklist
Added by the opencode bot (AI-generated).
Related: #58163