Repository navigation
fix(sandbox): auto-retry transient SANDBOX_START failures without a refresh - #5195
Merged
Merged
Conversation
added 2 commits
July 24, 2026 13:01
FLIP inferred a lane change from horizontal delta (dx > 8px). A board-wide sideways shift (scrollbar toggling, centered row re-centering) moves every card, so all cards tilted at once and the laneOrder stagger delayed cleanup to ~1.7s. Detect lane changes by the card's actual column (data-flip-lane) instead.
…efresh Concurrency-transient starts (lifecycle transition in progress / advisory lock busy) surfaced a 500 to the frontend that the user had to clear by refreshing. The server already tags these with a 'retry shortly' marker; retry them in-place via react-query so the booting overlay holds instead of flipping to an error state.
pedrofrxncx
enabled auto-merge (squash)
July 24, 2026 16:10
decocms Bot
pushed a commit
that referenced
this pull request
Jul 24, 2026
PR: #5195 fix(sandbox): auto-retry transient SANDBOX_START failures without a refresh Bump type: patch - decocms (apps/api/package.json): 4.123.1 -> 4.123.2 Deploy-Scope: web
pedrofrxncx
pushed a commit
that referenced
this pull request
Jul 27, 2026
#5240) Reverts #5112 (share agent sandboxes by branch), #5116 (always share agent sandboxes) and #5132 (use shared staging branch), restoring the pre-#5112 behaviour: hosted agent sandboxes are per-user again, and a new GitHub-backed thread gets a generated branch instead of `staging`. Reconstructed against current paths rather than reverted: #5120 split apps/mesh into apps/api + apps/web and hoisted branch-name.ts, runtime-defaults.ts and thread/schema.ts into packages/shared, and #5174 deleted vm-events.ts outright, so none of the three commits reverse-apply. Core change: SandboxId goes back to a flat `{ userId, projectRef }` and sandboxIdKey back to `userId:projectRef`, so every hosted claim handle changes. Live shared claims must be drained BEFORE this deploys. Also reverted, because they only exist inside the shared model: - #5225 withoutLegacyAgentSandboxEntries — left in place it would strip the sandboxMap entries the reverted server writes back, leaving shouldAutoStart permanently true (silent, compiles fine) - #5219 resolveSharedThreadVm and the shared-scope branch - #5183 stale-provisioning reset (lived inside the deleted storage) Deliberately preserved: - migrations 137/138 and their index.ts entries — Kysely's #ensureNoMissingMigrations runs unconditionally, so deleting an applied migration crash-loops every pod. The tables are dropped by a follow-up forward migration after the drain, not by this commit. - #5114/#5118 withClaimGitLock, #5126 org-context guard, #5143 analytics gate, #5171 owner-keyed thread graft, #5195/#5207/#5210/#5221 client auto-retry, the daemon status-code train and the settings-validation train - #5112's org-fs least-privilege narrowing and the start dedup key fix - #5116's squashed queue-tray pluralization (en + pt-br) - the remote-branch-name validations #5132 deleted, since this restores the dynamic origin/HEAD lookup that made them load-bearing Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Pedro França <[email protected]>
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.
Summary
Transient
SANDBOX_STARTfailures surfaced a 500 to the frontend that the user had to clear by refreshing the page. This retries them in-place so the booting overlay holds and the sandbox comes up on its own.Found via VictoriaLogs (prod,
eks-serverless, last 24h): of 20SANDBOX_START5xx, 6 were concurrency-transient — a racing start/stop/reap holding the per-branch lock:agent sandbox lifecycle transition in progress … retry shortly(agent-sandbox-sessions.ts:207)… lifecycle lock busy … retry shortly(agent-sandbox-sessions.ts:95)sandbox advisory lock busy … retry shortly(*-runner-state.ts)The server already tags exactly these with a
retry shortlymarker. This keys off that contract and lets react-query retry the mutation (retry/retryDelay, matching the existinguse-publish-gate.tspattern). The mutation staysisPendingacross retries, so the UI keeps showing "Booting…" instead of flipping to the error state — no refresh.Scope
Retries only the
retry shortlyclass. Deliberately excluded:Sandbox start was superseded by a stop— retrying could resurrect a sandbox the user just stopped.did not become ready within 180s,tunnel_*) — real failures; another ~180s retry usually fails the same way and is worth surfacing.Testing
bun teston the new file passes;bun run fmtclean.Summary by cubic
Auto-retries transient SANDBOX_START errors so sandboxes recover without a page refresh, and fixes task-board tilt by detecting real lane changes only.
@tanstack/react-query(up to 6 attempts with backoff to 5s). The mutation stays pending so the “Booting…” overlay holds. Added a unit test to pin the retry predicate to the server messages.data-flip-lane, so horizontal layout shifts don’t tilt every card. Added the attribute to task cards.Written for commit 92b1936. Summary will update on new commits.