You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🤖 feat: cross-backend evidence for background processes in SSH, Docker, dev container and multi-project workspaces #4889
Split out of #4857, whose MCP server, init hook and one-off command leases landed separately. Two background-process gaps from its comments remain:
Remote background records are invisible to the structural mutation gate. The gate (acquireStructuralMutationGate) sees background processes through host-local spawn records (hasOrphanedRunningBackgroundProcesses, plus bind-mounted devcontainer records). For SSH/Coder and Docker workspaces the records live on the remote host or inside the container, so another backend's background command there does not make rename, remove or a checkout-deleting archive refuse.
No cross-backend name claim outside host-local runtimes.spawnRecordsAreHostLocal classifies MultiProjectRuntime (local multi-project workspaces), SSH/Coder, Docker and devcontainer as non-host, so two backends that start same-named background commands there at the same time can share a spawn directory (🤖 fix: claim background process names across backends #4874 fixed host-local runtimes only).
Proposed fix
Have BackgroundProcessManager hold a host-local workspace use lease (WorkspaceUseLeases.hold, a new kind or exec) per workspace while it tracks a running process there, for every runtime.
Treat local multi-project records as host-local for the spawn-name claim (or claim names through a host-local lock keyed by workspace).
Not done in #4857's PR because BackgroundProcessManager is being changed concurrently for #4878/#4882; this should land after those.
Coordinator triage (2026-09-28): parking this in the backlog. Every multi-backend fix today (#4861#4866#4874#4890#4900#4904#4907#4908#4915#4917#4919#4921#4922#4923#4929) produced 1–3 new residual issues like this one. Each residual needs two user actions in two apps at once, or new persisted mechanism. We will pick these up when dogfooding of concurrent desktop + xum server use shows one of them actually happens, rather than keep adding mechanism.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
#5464 adds a TLA+ model and a deterministic repro for part of this issue. It does not fix it.
Reproduced part: on runtimes whose records are not host-local (SSH/Coder, Docker, devcontainer, multi-project), backends share no record-name lock, and the name probe in backgroundProcessManager.ts treats a record that has exit_code as free. So a second backend reinitialises a record directory that the first backend still tracks.
TLC: formal/background-processes/MC_name_remote_serial.cfg violates NoReuseWhileTracked. MC_name_remote.cfg also violates OneProcessPerDir.
The model also shows the documented gate gap: another backend's mutation gate does not see SSH/Docker records (MC_gate_ssh_spawn, MC_gate_docker_spawn).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
#5486 (merged as eaead8d) fixes the reproduced part of this issue: on non-host runtimes (SSH/Coder, Docker, devcontainer, multi-project) a second backend no longer reinitialises a background record directory another backend still tracks.
Spawn now claims the record name with an atomic mkdir (no -p) on the runtime. Any existing directory, including a settled one with exit_code, counts as taken, so the second backend gets a suffixed name. No new persisted state.
Formal model: BgSpawnName.tla gained an AtomicClaim fix probe. MC_name_remote_fixed holds NoReuseWhileTracked and OneProcessPerDir. The faithful MC_name_remote* configs still describe the old code.
Repro #4889: … B does not reinitialise the record directory A still tracks is now a plain test, and it fails at its target with the fix reverted.
Not covered here, so this issue stays open: the broader cross-backend evidence requirements for SSH/Docker/multi-project. Follow-up for the cost this fix adds (remote names reused across sessions grow suffixes): #5485.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $10.41
Merged into this issue from the backlog triage (2026-10-19): #5485. An agent read every issue in this group and found that one worker can handle them together with this issue, so their open items now live here:
Activity
linear-code commentedon Sep 27, 2026
MUX-341
🤖 feat: workspace use leases for MCP servers, init hooks and executeB…
ThomasK33 commentedon Sep 28, 2026
Coordinator triage (2026-09-28): parking this in the backlog. Every multi-backend fix today (#4861 #4866 #4874 #4890 #4900 #4904 #4907 #4908 #4915 #4917 #4919 #4921 #4922 #4923 #4929) produced 1–3 new residual issues like this one. Each residual needs two user actions in two apps at once, or new persisted mechanism. We will pick these up when dogfooding of concurrent desktop +
xum serveruse shows one of them actually happens, rather than keep adding mechanism.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high🤖 fix: startup recovery leaves sub-agent tasks that another live back…
🤖 fix: prune old settled background records so reused names stop grow…
ThomasK33 commentedon Oct 2, 2026
#5464 adds a TLA+ model and a deterministic repro for part of this issue. It does not fix it.
Reproduced part: on runtimes whose records are not host-local (SSH/Coder, Docker, devcontainer, multi-project), backends share no record-name lock, and the name probe in
backgroundProcessManager.tstreats a record that hasexit_codeas free. So a second backend reinitialises a record directory that the first backend still tracks.formal/background-processes/MC_name_remote_serial.cfgviolatesNoReuseWhileTracked.MC_name_remote.cfgalso violatesOneProcessPerDir.src/node/services/backgroundProcessesFormalRepro.test.ts, "🤖 feat: cross-backend evidence for background processes in SSH, Docker, dev container and multi-project workspaces #4889: same-name spawns from two backends on a non-host runtime › B does not reinitialise the record directory A still tracks".MC_gate_ssh_spawn,MC_gate_docker_spawn).Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:highThomasK33 commentedon Oct 2, 2026
#5486 (merged as eaead8d) fixes the reproduced part of this issue: on non-host runtimes (SSH/Coder, Docker, devcontainer, multi-project) a second backend no longer reinitialises a background record directory another backend still tracks.
mkdir(no-p) on the runtime. Any existing directory, including a settled one withexit_code, counts as taken, so the second backend gets a suffixed name. No new persisted state.BgSpawnName.tlagained anAtomicClaimfix probe.MC_name_remote_fixedholdsNoReuseWhileTrackedandOneProcessPerDir. The faithfulMC_name_remote*configs still describe the old code.#4889: … B does not reinitialise the record directory A still tracksis now a plain test, and it fails at its target with the fix reverted.Not covered here, so this issue stays open: the broader cross-backend evidence requirements for SSH/Docker/multi-project. Follow-up for the cost this fix adds (remote names reused across sessions grow suffixes): #5485.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$10.41🤖 tests: TLA+ model of background processes + failing repros (coder#5464
🤖 fix: claim remote background record names with an atomic mkdir (cod…
🤖 fix: claim a batch of remote background record names in one exec (c…
🤖 tests: cover coder#5465 background-process cases in the TLA+ model (c…
ThomasK33 commentedon Oct 19, 2026
Merged into this issue from the backlog triage (2026-10-19): #5485. An agent read every issue in this group and found that one worker can handle them together with this issue, so their open items now live here:
The merged issues are closed with a pointer back here. Reopen one if it needs its own tracker.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:xhigh• Cost:$17.91🤖 tests: wait for the wrapper's exit code in seven background-process…