Repository navigation
refactor(api): remove dead legacy /api/vm-events route - #5174
Merged
Merged
Conversation
The org-scoped route migration already superseded this: the browser now opens `/api/:org/sandbox/:virtualMcpId/:branch/events` (sandbox-proxy.ts's handleVmEvents, sharing sandbox-events-handler.ts), so the legacy `/api/vm-events` mount in app.ts and its route file have no remaining caller.
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.
Part of the org-scoped
/:orgroute-prefix migration (#3256): finds a mount that was left dangling after the migration finished elsewhere.apps/api/src/api/app.tsstill mounted/api/vm-events(legacy, with a deprecation log) pointing atapps/api/src/api/routes/vm-events.ts, with a comment saying "the new/api/:org/vm-eventsmount is wired in a later task." That task already happened, just under a different URL shape: the VM-events SSE was consolidated into the unified sandbox proxy (sandbox-proxy.ts,handleVmEvents/sandbox-events-handler.ts) and now lives at/api/:org/sandbox/:virtualMcpId/:branch/events. The frontend (apps/web/src/components/sandbox/hooks/sandbox-events-context.tsx:249) already builds only that URL. So the legacy/api/vm-eventsmount and its route file have zero remaining callers.Net reduction: -644 lines (
app.ts-17,vm-events.tsdeleted, -627). Confirmed zero references:grep -rn "routes/vm-events\|createVmEventsRoutes"acrossapps/api/srcreturns nothing after the change, and no e2e/test file imports it.To confirm:
cd apps/api && bunx tsc --noEmit(passes), andrg "routes/vm-events|createVmEventsRoutes" apps/api/src(no hits).Locally ran:
bun run fmtandcd apps/api && bunx tsc --noEmit(both clean). No test file existed for the deleted route (pure dead-code delete, not a behavior change), so no test needed removal. Full CI validates the rest.Summary by cubic
Removed the dead legacy
/api/vm-eventsroute and handler. VM event streaming now lives at/api/:org/sandbox/:virtualMcpId/:branch/events, so this cleanup has no behavior impact and completes the org-scoped route migration./api/vm-eventsinapps/api/src/api/app.ts.apps/api/src/api/routes/vm-events.ts(legacy SSE handler).Written for commit c13c806. Summary will update on new commits.