mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 21:03:06 +00:00
1.5 KiB
1.5 KiB
Workbench Session Creation Must Not Trigger Inline Provisioning
Problem
Creating a workbench tab currently provisions the whole task if no active sandbox exists. A user action that looks like "open tab" can therefore block on sandbox creation and agent setup.
Target Contract
- Creating a tab returns quickly.
- If the task is not provisioned yet, the tab enters a pending state and becomes usable once provisioning completes.
- Provisioning remains a task workflow concern, not a workbench request concern.
Proposed Fix
- Split tab creation from sandbox session creation.
- On
createWorkbenchSession:- create session metadata or a placeholder tab row immediately
- if the task is not provisioned, enqueue the required background work and return the placeholder id
- if the task is provisioned, enqueue background session creation if that step can also be slow
- Add a tab/session state model such as:
pending_provisionpending_session_createreadyerror
- When provisioning or session creation finishes, update the placeholder row with the real sandbox/session identifiers and notify the workbench.
Client Impact
- The workbench can show a disabled composer or "Preparing environment" state for a pending tab.
- The UI no longer needs to block on the mutation itself.
Acceptance Criteria
createWorkbenchSessionnever calls task provisioning inline.- Opening a tab on an unprovisioned task returns promptly with a placeholder tab id.
- The tab transitions to ready through background updates only.