Context
PR #3940's model-driven task_workspace_lifecycle archive path (refuseLiveUserActivity) pairs archive admission with streams, sends, queued turns, background bash, terminals, desktop sessions, workflows, executeBash, attachment staging, and file-completion refreshes. MCP server lifecycle is not paired.
Problem (Codex review round 19, P2)
Condition: the owned peer has a cached workspace stdio MCP server, or MCP prompt discovery (workspace.mcp.prompts.list) races a Snapshot/Coder-stop archive.
- The archive gate neither observes MCP server startup/leases nor stops cached servers; only workspace removal calls
stopServers.
- A model-driven archive can therefore delete a managed checkout beneath a running stdio MCP process (losing post-snapshot writes), or a prompt-discovery request entering mid-archive can reconnect and re-wake a stopped Coder runtime.
Suggested direction
- Pair MCP server startup/prompt discovery with archive admission using the established synchronous-entry pattern (
archivingWorkspaces guard + preflight admission counter checked by the refuseLiveUserActivity gate).
- Stop cached workspace MCP servers during archive before runtime cleanup (mirroring what removal does via
stopServers), or refuse archive while servers hold leases.
References
Generated with mux • Model: anthropic:claude-fable-5 • Thinking: xhigh
Context
PR #3940's model-driven
task_workspace_lifecyclearchive path (refuseLiveUserActivity) pairs archive admission with streams, sends, queued turns, background bash, terminals, desktop sessions, workflows, executeBash, attachment staging, and file-completion refreshes. MCP server lifecycle is not paired.Problem (Codex review round 19, P2)
Condition: the owned peer has a cached workspace stdio MCP server, or MCP prompt discovery (
workspace.mcp.prompts.list) races a Snapshot/Coder-stop archive.stopServers.Suggested direction
archivingWorkspacesguard + preflight admission counter checked by therefuseLiveUserActivitygate).stopServers), or refuse archive while servers hold leases.References
WorkspaceService.archiveUnlocked(refuseLiveUserActivity), pairing pattern inacquirePreflightAdmissionstopServers(removal path)src/node/services/taskService.ts)Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh