Skip to content

Archive gating does not pair with workspace MCP server lifecycle (stdio servers survive archive; prompt discovery can re-wake Coder) #3946

Description

@ThomasK33

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions