Skip to content

Add safe task workspace switching - #1214

Draft
mrubens wants to merge 3 commits into
developfrom
agent/task-workspace-switching
Draft

Add safe task workspace switching#1214
mrubens wants to merge 3 commits into
developfrom
agent/task-workspace-switching

Conversation

@mrubens

@mrubens mrubens commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

  • Add a durable task workspace transition model and migration.
  • Let users change the workspace for an active standard web task from the task overflow menu.
  • Validate that the current workspace is idle, clean, and fully pushed before switching.
  • Start a fresh successor run in the selected environment while preserving the task conversation.
  • Scope source-control credentials and environment configuration to the selected target workspace across supported providers.
  • Document the workflow and its safety requirements.

Why

Environment selection was previously fixed when a task run started. If the wrong environment was selected, the task could not recover in place even when another configured environment had the required repositories. This adds an explicit, auditable transition instead of forcing users to abandon the task or broaden repository access.

Impact

For eligible active tasks, More actions → Change workspace now presents configured environments and performs the transition after safety checks. The initial version is intentionally limited to standard tasks launched from the web UI.

The transition is rejected while an agent turn is active or when the source workspace has dirty files, unpushed commits, or no upstream branch. Prompt and steering delivery are fenced once transition preparation begins.

Validation

  • pnpm lint
  • pnpm check-types
  • Pre-push checks: oxlint, residual ESLint, fast typecheck, and knip
  • Focused tests covering transition state, Git inspection and preparation, worker prompt fencing, queueing, controller behavior, SDK resume behavior, web UI, and database constraints

Follow-ups

  • Add background reconciliation for interrupted transitions.
  • Expand the entry point to additional task and integration surfaces after the web flow is proven.

@roomote-community

roomote-community Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

  • apps/worker/src/sandbox-server/procedures/prepareWorkspaceTransition.ts:9 The transition fence is shared by all sandbox-server request contexts.
  • packages/cloud-agents/src/server/task-run-queue.ts:2226 The persisted workspace configuration is used during worker setup.

Reviewed b9f70c3

Comment thread packages/cloud-agents/src/server/task-run-queue.ts
Comment thread apps/worker/src/sandbox-server/procedures/prepareWorkspaceTransition.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant