Repository navigation
Description
Summary
A Workspace should not become its own Substrate actor with its own lifecycle that tasks attach to. A workspace is metadata the runner uses when a task starts. Users who want a long-lived environment to branch from can run a task and fork other tasks from it.
What a Workspace is for
A Workspace describes what a task needs to start, for example:
- which MCP servers to fetch from a registry
- which skills to download
- which repositories to clone, which inline files to write, and which setup commands to run
All of this is task startup configuration. ax-runner should read and apply it when it starts the task, inside that task's own actor. A separate actor for the workspace isn't needed.
Workspace metadata is time sensitive
What a workspace resolves to depends on when it is resolved:
- Registries change. The MCP servers a registry returns, their endpoints, and their versions can change at any time. If you resolve them once when the workspace is created, every task that starts later gets whatever was current back then.
- Skills and repositories move. A skill's latest version and a branch's head commit change all the time. If setup is baked in ahead of time, tasks run against stale content without anyone noticing.
- Policy can change. If an admin removes an MCP server from the registry or revokes a skill, the change should apply to the next task that starts. It shouldn't wait for someone to rebuild the workspace.
Because of this, the runner should resolve workspace metadata when each task starts, so every task gets the current state. A separate workspace actor would freeze the metadata at the time the workspace was set up and copy that frozen state into every task that uses it. If a user really does want a frozen setup, they can say so explicitly by forking from a tagged task. That way it's a choice the user makes, not the default.
Why not a separate actor
- Two lifecycles. A workspace actor has to be provisioned, suspended, resumed, garbage-collected and authorized separately from the tasks that use it. That's more state in the reconciler and the store, and more ways for the two to get out of sync.
ax suspendof a large workspace can lose the workspace while every command reports success #453 already shows how hard it is to keep workspace state correct inside one task. - Substrate already covers the use cases. Shared state between tasks is better served by primitives that already exist or are planned:
- Shared volumes for data several tasks read or write at the same time.
- Tagging and forking for "set up once, branch many times": start a task, let its setup finish, tag it, and fork new tasks from that point. You get the pre-warmed behavior without a new resource type.
- Simpler mental model. One task, one actor. The workspace is just the startup configuration of that actor.
Proposal
- Keep
Workspaceas a declarative config resource that tasks reference. Don't back it with an actor. ax-runnerresolves and applies workspace config (MCP servers, skills, clones, files, commands) every time a task starts, against the current state of registries and sources.- Document forking from a tagged task as the way to reuse an expensive setup, and shared volumes as the way to share data between tasks that are running at the same time.
- Remove or drop any existing or planned code paths that give a workspace its own actor.
Related
- Epic: v1alpha1 API updates (Profile, Workspace, Task, Gateway) #563 (v1alpha1 API epic, "Pre-warmed
Workspace") - Support running a follow-up turn on the same task workspace (session reuse) #649 (follow-up turns on the same task workspace)
- [RFC] Shared golden snapshots: canary goldens, anchored Tasks, and Task clones #467 (shared golden snapshots and task clones)
cc @yongruilin @YoyinZyc thoughts?
Activity
yongruilin commentedon Nov 22, 2026
Makes sense to me. I think it feels cleaner and keeps the lifecycle much simpler
Two things:
spec.setup.gatewaywas there so setup could clone a private repo without giving the running agent those creds. If setup runs in the Task's actor, the Task's Gateway has to carry that access for the whole run — do we want this separation? Maybe we can let a forked task switch to a narrower spec.gateway to keep this credential separation?ax forkis not there yet.YoyinZyc commentedon Nov 23, 2026
Off the top of my head, some trade-off:
Pros:
Taskaligns withActor. Thesnapshot,tag,profileare kind of the propagation ofTasksnapshotmanagement. With the currentWorkspace, we have to manage or refresh the workspace snapshot to avoid its staleness.Cons:
Open questions: