feat(workspaces): Add database-backed repository workspaces - #1420
Open
sentry-junior[bot] wants to merge 34 commits into
Open
feat(workspaces): Add database-backed repository workspaces#1420sentry-junior[bot] wants to merge 34 commits into
sentry-junior[bot] wants to merge 34 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
August 11, 2026 16:48
dcramer
reviewed
Aug 11, 2026
Reject an already-aborted workspace switch before mutating recipe state or stopping the live sandbox.
Order workspace repos by provider/repo/checkout path in the store and normalize that order in the snapshot profile hash so identical recipes do not rebuild snapshots from query-order churn.
If ensureReadySandbox fails after acquisition, stop the replacement session instead of dropping the only reference without cleanup.
Do not stop a resumed durable sandbox when network policy or prepare fails. Leave the VM for a later reacquire instead of wiping prior state.
Capture prepareWorkspace recipes by value, restore cold durable sandbox hints on failed switch, and omit isPrimary from snapshot profile hashes.
After aborting an in-flight acquire, stop any session remembered while awaiting that promise, not only the pre-await previous sandbox.
When an aborted acquire still reports a durable sandbox ref, clear that hint after stopping the late session so switch boots the target fresh.
Bare rejects.toThrow() failed lint under --deny-warnings.
Share the reserved root names with cloneRepository and fail workspace prepare before cloning into skills, data, or .junior. Co-Authored-By: David Cramer <david@sentry.io>
Defer stopping the previous session until the replacement is ready so a cancelled or failed switch can put the live sandbox back.
Preserve workspaceId and profile hash on SandboxRef restore when the workspace recipe row cannot be loaded, instead of silently stripping the association on the next report.
Forward the acquire AbortSignal into prepareWorkspaceSnapshot so long setup scripts stop when a workspace switch or turn is cancelled.
Keep durable sandbox clear signals through run adapters so a failed inline persist still clears on the final write. Reject reserved checkout paths case-insensitively, and sort workspace recipe repos with code-point order for locale-stable profile hashes.
Drop stored checkout_path from workspace recipes. Clone workspace and
ad-hoc GitHub repositories under repos/{name} so setup scripts can rely
on a stable layout, and reject short-name collisions.
findSingleRepositoryDirectory now looks in repos/{name} so ad-hoc and
workspace clones keep automatic AGENTS.md selection after the layout change.
Invalid workspace repo names no longer throw during AGENTS.md capture. Fall back to single-repo discovery or skip instructions instead of aborting the agent turn.
dcramer
force-pushed
the
feat/workspace-mvp
branch
from
August 14, 2026 06:42
e003800 to
214dfb3
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 214dfb3. Configure here.
Always including `workspace: null` changed every base dependency profile hash and would bust cached snapshots on deploy. Only include the workspace recipe when a workspace is selected.
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.

Closes #1417.
Adds database-backed repository Workspaces that agents can list and switch through the core tool registry. Junior stores install-wide recipes and repository rows in SQL. The active Workspace remains part of the durable Sandbox reference, so conversation history and resumed sessions keep the selected repository context.
Workspace activation now builds and probes a candidate Sandbox before it persists the new reference or replaces the live Sandbox. A failed or canceled candidate leaves the current Sandbox and durable state unchanged.
GitHub repositories clone through the existing host-managed credential egress with normal HTTPS remotes. Installation credentials are not added to Sandbox environment variables or Git config. Each complete Workspace recipe selects one snapshot profile and one build path, without a base-to-Workspace snapshot cache graph.