resolveSessionContinuity (#408) makes a re-opened session continue the repo's conversation for four days. Over MCP that is unreachable: the only tool that can open a session hardcodes the flag that turns it off.
The three coding-session tools, and why none of them can do it
coding_session_fresh — opens, but forces cold. workers/mcp/src/index.ts:1051:
const d = await authedCall(`/v1/instances/${instance_id}/coding/sessions`, sessionToken, { method: "POST", body: JSON.stringify({ repoId, engineId: engine_id || "claude", fresh: true }) }, this.env);
fresh: true reaches lib/coding-session-open.ts:227:
if (opts?.forceFresh) return resolveSessionContinuity({ engine, previous: null, forceFresh: true });
which returns mode: "fresh", resumeFrom: null, reason "you asked for a clean slate". The tool is doing exactly what its description promises ("clean state, no --resume") — it is the right tool, and it is the only one.
coding_session_message — requires an already-active session. index.ts:915-917:
const r = (await authedCall(`/v1/instances/${instance_id}/coding/sessions`, sessionToken, {}, this.env)) as { sessions?: Array<{ id: string; status: string }> };
const sid = session_id || sessions.find((s) => s.status === "active")?.id;
if (!sid) return text("No active coding session found.");
It GETs the list and looks for status === "active". It does not open one.
coding_session_restart — same lookup, same dead end (index.ts:940-944).
Confirmed empirically 2026-08-17 against instance bd43f4de with its previous session reaped: coding_session_message returned "No active coding session found."
grep -c 'coding/sessions, sessionToken, { method: "POST"' workers/mcp/src/index.ts→ **1**, and that one iscoding_session_fresh`. There is no other door.
Why this matters more than a missing tool usually does
The console reaches the resuming path (routes/coding.ts:202, lib/coding-session-open.ts:333, both passing continuity.resumeFrom into startSessionOnRunner). MCP is the surface an owner uses to check on and continue work from somewhere other than the console — which is the exact scenario #408 exists for. So the capability is built, tested, and shipped, and is available from precisely one of its two entry points.
Working around it required calling POST /v1/instances/:id/coding/sessions directly with a token lifted from the CLI's own ~/.config/proagentstore/session.json. That is not a workflow to document; it is evidence the tool is missing.
Fix
Small: expose the create call without fresh: true. Either
- a new
coding_session_open (instance_id, repo_id?, engine_id?) that POSTs without the flag and returns the continuity block the route already sends back, or
- an optional
fresh boolean on coding_session_fresh, defaulting false, and rename it — though a tool whose name says "fresh" defaulting to "not fresh" is worse than a second tool.
Prefer the first. Return continuity.reason verbatim in the tool's text output so a caller can say which conversation it got — the route already computes it and #697 covers the console side of the same omission.
Also worth doing while here: coding_session_message should be able to wake a sleeping repo rather than refusing. "No active coding session found" is the MCP-side spelling of the same leak filed in #695 — the caller asked to talk to an agent and got told about our process lifecycle. Once an open-with-continuity tool exists, message should fall back to it instead of erroring.
Surface-lock note: adding a tool name bumps MCP_SERVER_VERSION and appends a SURFACE_LOCK entry (see workers/mcp/src/server-version.ts and surface-lock.ts), plus the counts in tool-count.ts and tool-metadata.ts. pnpm docs:drift names the doc claims that restate them.
resolveSessionContinuity(#408) makes a re-opened session continue the repo's conversation for four days. Over MCP that is unreachable: the only tool that can open a session hardcodes the flag that turns it off.The three coding-session tools, and why none of them can do it
coding_session_fresh— opens, but forces cold.workers/mcp/src/index.ts:1051:fresh: truereacheslib/coding-session-open.ts:227:which returns
mode: "fresh",resumeFrom: null, reason"you asked for a clean slate". The tool is doing exactly what its description promises ("clean state, no --resume") — it is the right tool, and it is the only one.coding_session_message— requires an already-active session.index.ts:915-917:It GETs the list and looks for
status === "active". It does not open one.coding_session_restart— same lookup, same dead end (index.ts:940-944).Confirmed empirically 2026-08-17 against instance
bd43f4dewith its previous session reaped:coding_session_messagereturned "No active coding session found."grep -c 'coding/sessions, sessionToken, { method: "POST"' workers/mcp/src/index.ts→ **1**, and that one iscoding_session_fresh`. There is no other door.Why this matters more than a missing tool usually does
The console reaches the resuming path (
routes/coding.ts:202,lib/coding-session-open.ts:333, both passingcontinuity.resumeFromintostartSessionOnRunner). MCP is the surface an owner uses to check on and continue work from somewhere other than the console — which is the exact scenario #408 exists for. So the capability is built, tested, and shipped, and is available from precisely one of its two entry points.Working around it required calling
POST /v1/instances/:id/coding/sessionsdirectly with a token lifted from the CLI's own~/.config/proagentstore/session.json. That is not a workflow to document; it is evidence the tool is missing.Fix
Small: expose the create call without
fresh: true. Eithercoding_session_open(instance_id, repo_id?, engine_id?) that POSTs without the flag and returns thecontinuityblock the route already sends back, orfreshboolean oncoding_session_fresh, defaulting false, and rename it — though a tool whose name says "fresh" defaulting to "not fresh" is worse than a second tool.Prefer the first. Return
continuity.reasonverbatim in the tool's text output so a caller can say which conversation it got — the route already computes it and #697 covers the console side of the same omission.Also worth doing while here:
coding_session_messageshould be able to wake a sleeping repo rather than refusing. "No active coding session found" is the MCP-side spelling of the same leak filed in #695 — the caller asked to talk to an agent and got told about our process lifecycle. Once an open-with-continuity tool exists,messageshould fall back to it instead of erroring.Surface-lock note: adding a tool name bumps
MCP_SERVER_VERSIONand appends aSURFACE_LOCKentry (seeworkers/mcp/src/server-version.tsandsurface-lock.ts), plus the counts intool-count.tsandtool-metadata.ts.pnpm docs:driftnames the doc claims that restate them.