feat(tasks): warm cloud sandbox while composing, reuse on submit#2869
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "feat(tasks): warm cloud sandbox while co..." | Re-trigger Greptile |
30105a3 to
59d7630
Compare
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Speculatively warm a full idling Run while the user composes a cloud task (the backend boots a sandbox, clones, checks out the branch, and starts the agent, then idles awaiting the first message). On submit the normal create+run path transparently reuses and activates that Run, so the user does not pay the agent start latency at submit time. The warm pool is backend-owned: useWarmTask just fires an idempotent, debounced warm request on typing (gated behind the tasks-prewarm-sandbox flag), and the create call sends the selected branch so the backend can match an idling warm Run. No client-side handle, dedup, or release — the backend dedups and reaps.
59d7630 to
f0eff4e
Compare
Contributor
|
Reviews (2): Last reviewed commit: "feat(tasks): warm cloud sandbox while co..." | Re-trigger Greptile |
skoob13
approved these changes
Jun 24, 2026
| lastWarmedKeyRef.current = null; | ||
| log.warn("Failed to warm task", { error }); | ||
| }); | ||
| }, WARM_DEBOUNCE_MS); |
Contributor
There was a problem hiding this comment.
Do you think we need to kill them when someone leaves the page/app? There is no task killing pre-warmed, unused sandboxes.
Contributor
Author
There was a problem hiding this comment.
I kept it backend-owned, so we do kill them after 10 minutes of no message reaching the sandbox, so we don't need client-side logic for this
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
spawning a cloud task feels slow: the sandbox boot, repo clone, branch checkout, and the agent start all happen after the user hits submit. The user waits through provisioning before the agent does anything, we can try to optimize this lifecycle a bit
Changes
while the user composes a cloud task, fire an idempotent, debounced
warm(repo, branch)request so the backend can provision an idling Run ahead of submit. On submit, nothing special happens client-sideuseWarmTask: a fire-and-forget triggerbranchso the backend can match an idling warm Run for the exact selection