Prewarm skills during thread resume#26598
Draft
charliemarsh-oai wants to merge 4 commits into
Draft
Conversation
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.
Stacked on #26469.
Summary
Resuming a thread starts session initialization only after the app server has loaded the thread. Session initialization then resolves plugin skill roots and discovers skills before the resumed thread is ready, leaving that work serialized on the startup path.
This change starts the same plugin and skill warmup when
thread/resumebegins, allowing it to overlap with loading the thread. Config-scoped skill loads now use a shared in-progress result, so session initialization reuses either the active prewarm or its completed outcome instead of repeating discovery. Existing force-reload and cache invalidation paths continue to clear the config cache.In 30 alternating release-build pairs resuming the same Ruff session, the median
thread_and_widgetstartup phase decreased from 267ms on #26469 to 248ms on this branch. The branch was faster in 27 of 30 pairs, with a paired median improvement of 21ms. Median time to the first editable composer decreased from 1.043s to 1.026s; that end-to-end measurement is noisier because account/model bootstrap and network latency are outside this change.