Repository navigation
Hold sessions for cluster capacity instead of failing; clear working indicators when a session ends - #44
Open
josephschorr wants to merge 2 commits into
Open
Hold sessions for cluster capacity instead of failing; clear working indicators when a session ends#44josephschorr wants to merge 2 commits into
josephschorr wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…indicators when a session ends A burst of sessions (e.g. a stack of PRs made ready for review at once) could not all be scheduled, and every session still waiting at the 8m sandbox readiness deadline failed together, even though capacity was about to free up. Sessions whose pods are pending on a capacity shortfall are now held, with a queued notice in their thread, and resume on their own once scheduled, up to --capacity-hold-timeout (1h). Sessions the operator ends without the runner closing them out (boot failures, crashed runners) now have their channel status caption cleared and any in-progress plan cards marked stopped, and the watchdog clears its caption when it gives up on a stall.
A Running session that loses a detector or bundle pod to a capacity shortfall keeps the ordinary fail-closed deadline instead of being held, and a terminal session is never held. A hold timeout that would not extend the ordinary deadline no longer counts as a hold. The hold is released at a single point after both provisioning stages, and its transition times come from the reconciler's clock.
josephschorr
force-pushed
the
capacity-hold-and-terminal-cleanup
branch
from
November 6, 2026 16:38
2887eac to
a031792
Compare
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.
Motivation
A large stack of PRs was marked ready for review at once, starting a burst of reviewbot sessions at the same moment. The cluster could not schedule all of their sandboxes ("Insufficient cpu / memory"), so the ones that didn't fit waited. Every one still waiting at the 8-minute sandbox readiness deadline then failed together, even though the earlier sessions were about to finish and free exactly the room they needed.
Separately, when a session ended this way, or any other way the agent itself didn't close out (a failure before it started, a crashed agent), its Slack thread kept showing it as still working: the status line stayed up, and plan cards kept their in-progress hourglass.
Summary of changes
Hold sessions for capacity instead of failing them
CapacityHoldcondition while held. Its thread gets a "Queued for cluster capacity" notice that says when the hold will give up. For triggered sessions this notice is also what opens the thread, so a queued review is visible instead of silent.--capacity-hold-timeout. When a hold expires, the failure message says the cluster never had room, rather than blaming the session's tools.Clear "working" indicators when a session ends
Alternatives considered
Provenance
Ship gate
mage test:unitmage test:integrationmage test:e2eAll three suites pass on the final tree. An earlier unit run had one websocket timeout in an unrelated web package; it passes on its own and passed in the full re-run. The machine was heavily loaded at the time.
Regeneration
config/**changes. n/amage fmt:checkcouldn't run locally because of a package-manager signature error in the markdown/TypeScript formatter step.Coverage