Claude Code reserves the MCP server name `workspace`: it skips a --mcp-config entry so named with a warning and runs
on with no tools. The first workspace session therefore had no workspace tools; the model wrote tool calls as text
until its output ran out, and the call ended as done with no tool calls.
- The workspace session's server is `work` (route /mcp/task/work, tools mcp__work__*).
- Task Runner 1.3.7: the Claude adapter's guard reads the stream-json init event and stops the run when one of the
call's MCP servers is missing or failed, so the call fails with the reason instead of answering without its tools.
- The workspace system prompt says the tools are the only way to see or change the code, never to write tool calls as
text, and to stop when the tools are missing.
- The CLI queues the job as cli-queue: the runner runs it, so a runner restart resumes it (resumeJob still refuses
command-line runs, whose process belongs to the command).
- The launcher's passes fail a session whose job ended without ending it (deadline, cancel, a stop it does not resume
from) and end its workspace unless kept.
- A resumed job waits on the session's recorded call, even one that ended meanwhile, instead of queueing a second
session; the outcome is stored before the diff stat.
- The call may wait 30 min in all in the queue; the pod's time limit covers seeding, that wait and a margin. The launcher
does not park a workspace whose bound remote call is queued or leased.
- A job claims its session atomically; another job stops without touching the workspace. The CLI records the job id
only while none is set, and marks the session failed on any queueing error.
- Table workspace_sessions (kind, repo, base, item, prompt, environment, keep, time limit, state, outcome, workspace,
remote call, job), general enough for later implementation sessions; kind 'try' for now.
- `autocraft-server workspace try <repo> <sha> --item N --prompt TEXT [--workspace ID] [--env ID] [--keep]
[--deadline-sec N]` records the session and queues a workspace-try job with {repo, session}; the prompt stays out of
job params and logs.
- Step workspace-try (Fix stage, no lane, so the planner never queues it; 160 min): creates or takes the workspace,
waits for it to be ready (registered as the external wait "Workspace start"), queues the bound call with the fix-issue
patch prompt's model, effort and tier and only the workspace tools, awaits it, then logs the outcome and cost, tool
calls and shell time from workspace_calls, and the diff stat against the base commit with new files. The workspace
is ended unless kept.
- The job's own diff-stat exec is recorded as tool `report` and does not count toward the session's limits.
- The Task Runner does not send a workspace tool call again once the request may have reached the server; autocraft
tool and autocraft mcp report the cut-off so the model can look with shell_status.
- The listening connection opens in the background with a 5 s connect limit; Db.listen returns a subscription whose
listening() says whether notifications arrive, and the relay polls at the short interval until they do.
- A call whose bundle lists the workspace server is leased only to the claude harness.
- The job serves only calls queued under its call's live lease.
- Rows left running by an earlier process of the job are taken over when the server opens, before it listens: shell rows
go back to the session to re-attach, others fail with an unknown outcome.
- A claimed row keeps its arguments cut to the record size; a delivered result keeps its images as type, size and hash.
- A row the session left unsettled gets the result its call returned.
- awaitCall's cleanup steps each run when one before them fails.
- queueWorkspaceCall refuses a workspace another queued or leased call is bound to, unless that call is the parent.
- workspaces.remote_call_id binds a workspace to the remote call whose session uses it; workspace_calls.run_id records
the lease run a relayed call came from.
- Dashboard: the workspace server on /mcp/task/workspace and the tool route queues each call as a workspace_calls row
with its arguments whole and waits for the row's result with keep-alive ticks; a call still queued when the lease ends
is refused. Workspace tool bodies may be up to 12 MiB.
- Job: awaitCall serves the workspace bound to its call, runs claimed rows side by side on the job's WorkspaceSession
(which settles each row), hands rows still running after a restart back to the session, and refuses queued rows when
the call ends.
- Wake: Db.notify and Db.listen, Postgres NOTIFY on one listening connection per handle that reconnects; the relay polls
every 10 s behind it, and at the model queue's interval on SQLite.
- Tool replies carry image content after the text: protocol 5 (3 and 4 still accepted); Task Runner 1.3.6 falls back
through 4 and 3 and prints a line for images in autocraft tool.
- queueWorkspaceCall queues a session call with the workspace server and binds the workspace in one transaction.
Offline steps that mount the build dirs run rustc through sccache against the
read-only WebDAV endpoint set with --sccache-url, when the repo has a CI gate.
sccache keys a compile on the compiler, its own release, the arguments, every
CARGO_* variable and the working directory, so a cached step matches the gate's
job: the CI checkout path with its default target dir, CARGO_HOME, the gate's
job env (CARGO_TERM_COLOR given to rustc only), dev-strip, and the store
sccache/<cache-version>. The pod carries craft.build/cache=read; the step ends
with sccache --show-stats. The rust-stable image pins Rust 1.100.0 and installs
the checksum-verified sccache 0.18.0 release.
The runner sends SIGTERM to the job process alone. The job refuses new writes (WritesStoppedError, so a
resumed run makes them), waits up to 7 s for the writes it has begun (tracked from begin() to finish()
in write.ts), saves its usage, then stops the rest of its process group and exits 143. SIGKILL to the
group still follows 10 s after the SIGTERM.
A disk container (AutoCraft image) first in every step pod fails the task when its volume
holds more than the environment's storage, which local-path does not enforce; a per-step
time cap (maxStepSec) and sized /src emptyDirs bound the rest, as docs/operations.md
explains. Tasks are claimed one at a time and every claim that cannot start goes back to
the queue. A pod stuck in deletion or on a node that stopped reporting, or running past a
deadline Kubernetes should have enforced, loses its task; a failed create of a later
stage's pod is retried with backoff before the task is lost. The launcher owns its tasks
(reapLost skips them) and keeps them alive even while the API is down; each container's
output is logged once; the pending health text stays stable; kubernetes environments
have no usable env key; the namespace cannot change while tasks run; pods select the
configured architecture; a source pod killed before it reports loses the task; a step's
own exit 124 before its limit is an ordinary failure.
The act lane pushes updated_at + HELD_STUCK_MS of each filing row into the planner's wake times, registered as the Act stage's 'Stopped held follow-up create' backoff. A run whose held create the write pacing held back fails with an error that starts with the pacing message, so the failure backoff skips it like other paced jobs.
A merged PR files its held issue unless the bound merge path ended before the merge time, so a pre-approval the merge itself cancels no longer drops it. Rows are bound to the press's own path: the pre-approval it created (runPipelineStep returns its id) or the decision's answer history count, so a new answer or pre-approval never revives one. createIssue treats an unsent request (failed app-token mint) as a clear failure and marks a write held back by pacing; pacing counts no try. A row left in filing is settled from its audit row. held_followups moves to its own topic outside the planner input, so row writes keep the failure backoff.
A card that answers Merge, or whose fix-up merges, stores its open_issue step in held_followups instead of opening it. The Act job of the PR's repo opens it once the PR merged (same act-open-issue write and audit, counted against Act's daily limit then), and drops it when the PR closes unmerged or the merge path ends. A filing row is written before the create, so a restart never opens two. Card lines and the choices card read "After the merge: open an issue in <repo>: ..."; the item page shows the held issue and why it was dropped.