Repository navigation
Description
Relocated from dezren39/darwin-nix#219 on 2026-10-28 (placement audit): mcpx's single source lives in developing-today/code (pkgs/mcpx); re-home tracked at #309. Original body below; issue references inside it are historical (dezren39/nix numbering).
Parent: #181
Summary
Four daemon-state defects. /v1/exec never marks its runs ephemeral, so session-scoped instances (a browser) are not released at the end of the run and wait for idle reaping; the CLI path sets MCPX_EPHEMERAL (read from code, not driven). The MCP surface is built once under a sync.Once and never rebuilt, so adapters added later are invisible, and a failed first build is cached for the daemon's life. /v1/protocol reports nativeElicit from the compiled default rather than the effective setting. mcpx stats opencode looks only for opencode.db, while both opencodes choose the filename by release channel.
Found while writing the comparison register (pkgs/mcpx/docs/compare/) and checked against the code at 05c78b2. Each row below links its register entry, which carries the value, effort, risk, the specification text and every source.
Register rows
| row | difference | mcpx @ 05c78b2 | effort |
|---|---|---|---|
| PM-12 | /v1/exec session-scoped instances outlive the run |
✗ — never marked ephemeral; waits for idle reap | S |
| PM-13 | MCP surface built once per daemon, never rebuilt | ✗ — sync.Once; new adapters invisible |
S |
| PM-15 | /v1/protocol reports nativeElicit from the default |
✗ — compiled default, not the setting | S |
| PM-21 | opencode database filename depends on release channel | ✗ — mcpx stats opencode reads opencode.db only |
S |
Evidence
internal/execsvc/execsvc.go:573-593 vs internal/cli/commands.go:694; internal/cli/serve_ask.go:234-254; internal/daemon/routes_proto.go:530 (the comment at :495-497 says it cannot disagree); v1:packages/core/src/database/database.ts:49, v2:packages/cli/src/database-path.ts:7.
What to do
One change each; the ephemeral release needs a test that fails today.
Ease · Impact · Related
Ease S · Impact med · Related: #78 (daemon state and caches), #189
Acceptance criteria
/v1/execruns are marked ephemeral, so session-scoped instances are released at the end of the run instead of waiting for idle reaping (PM-12).- The MCP surface is rebuilt when adapters/servers change; a failed first build is not cached for the daemon's life (PM-13).
/v1/protocolreports the effectivenativeElicitsetting, not the compiled default.mcpx stats opencodefinds the opencode database filename for the installed release channel, not onlyopencode.db.- Regression tests cover each of the four defects.
Activity
developing-today commentedon Oct 28, 2026
CODE-867
dezren39 commentedon Oct 28, 2026
History carried over from dezren39/darwin-nix#219 (verbatim, oldest first):
@dezren39 · 2026-10-28T04:30:11Z
🤖 Intake review — fleet monitor, 2026-10-27 run
pkgs/mcpx/docs/compare/register/process-model.md.05c78b2(2026-09-30). Re-verify each row against currentmainbefore fixing — a row may have moved since.51 remaining items
dezren39 commentedon Oct 30, 2026
Agent note — picked up (resume)
Merge pull request #2625 from developing-today/queue/3243-1942-daemon…
dezren39 commentedon Oct 30, 2026
Agent note — done (queue task 3243)
dezren39 commentedon Oct 30, 2026
🤖 Agent note · done
dezren39 commentedon Nov 3, 2026
Triage verdict: all four defects are fixed at current main — closing with evidence (
d3476bce7, 2026-11-03)Checked against the code, not the packet: every acceptance criterion is satisfied, with a regression test per defect, and the tests pass on current main today.
/v1/execnever marked runs ephemeralinternal/execsvc/execsvc.go:1115-1130—scriptEnvsetsMCPX_EPHEMERALunless the caller named a session, soexec-<runID>instances are released at run end instead of waiting for idle reapinginternal/execsvc/ephemeral_internal_test.go(passes)sync.Onceinternal/cli/serve_ask.go:347-430— surface rebuilt when its declared inputs change; a failed first build is not cached; replaced surfaces are retired (internal/mcpserver/server.go:2327)internal/cli/lazymcp_test.go(3 cases, pass)/v1/protocolreported the compiled defaultinternal/daemon/routes_proto.go:802reportss.set.Bool("proto.native"), i.e. the setting in force (and the daemon readssetper request, soPUT /v1/settingsreaches it)internal/e2e/conflicts2_test.go—TestProtocolReportsTheSettingInForce(passes)mcpx stats opencoderead onlyopencode.dbinternal/opencode/opencode.go:38-95— resolves the channel filename set (opencode.dbfor v1 latest/beta/prod,opencode-<channel>.dbfor v2 dev/next/…), plain path as fallbackinternal/opencode/paths_test.go(passes)Vehicles: PR #2625 (merged 2026-10-30T11:13:37Z, "fix remaining #1942 daemon-state defects — ephemeral exec runs, MCP surface rebuild, opencode channel DBs") and the follow-up
11551b8df(retire replaced MCP surface sessions; keep shared daemon PID out of ephemeral ownership).Tests re-run today on current main (all pass):
go test ./internal/execsvc ./internal/opencode ./internal/cli— okgo test ./internal/e2e -run TestProtocolReportsTheSettingInForce— okRegister note: the compare register's status column is explicitly pinned to
mcpx @ 05c78b2, so its ✗ cells are a dated snapshot, not a live claim — PM-15 in particular was already correct at the repo-migration commit (a03494f30). No doc change is owed by this issue; if a register truth-up is wanted it belongs to the truth-up work tracked under #1837/#1834 phase 3, not here.🤖 Agent note · state: done (closed)
bf419306)ses_e5e5e1353ceffeJh7tpGId1sUg· queue task 779511551b8df, mcpx: Phase 3 of #1834 — reviewable sampling in mcpx elicit + matrix/register truth-up + nix#256 evidence #1837dezren39 commentedon Nov 3, 2026
agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 40 (priority/normal). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03