Repository navigation
Description
Relocated from dezren39/darwin-nix#48 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
Backlog. The same plugin is wanted for codex, claude code, pi, manus and others. pkgs/mcpx/docs/opencode-plugin.md §5 separates what is general from what is opencode's.
Shape: a harness-free core that speaks the daemon's /v1 API over a unix socket (discovery ladder, client, timing, exec), plus a thin adapter per harness. plugin/opencode/mcpx/daemon.ts is already nearly that core; once a second harness exists, move it to plugin/core/.
Checked at 05c78b2:
daemon.tssays so itself: "Nothing here imports from opencode …mcpx-session.tsis opencode's adapter; this file is the part that ports" (plugin/opencode/mcpx/daemon.ts:34-38). It needs no binary: the ladder reads the daemon's info files and dials the socket, and spawnsmcpx --json statusonly as rung 4, the last fallback (plugin/opencode/README.md:83-110; chore(deps): bump build/buck/preludes/buck2-prelude fromd956689to880be56#53).- One runtime assumption to lift first: the socket client dials through Bun's
fetch({ unix })(daemon.ts:335-352). opencode runs plugins under Bun; a Node-hosted harness needsnode:httpwithsocketPath(or undici's unix dispatcher) behind the same interface. - Phase 2: delegated Manage cannot add members #171's guard (
TestThePluginReadsNoUndeclaredSetting,internal/settings/consumed_test.go:209-236) scans all ofplugin/**/*.ts(x), so aplugin/core/or a second adapter is covered without changes; every variable a new adapter honours must be declared ininternal/settings/plugin.go.
What an adapter must provide — only the first two are required, everything else degrades:
- a directory (to resolve which daemon)
- a session identifier (attribution, leasing, elicitation routing)
- somewhere to put environment variables, or a way to wrap tool calls
- a hook after a tool call (timings)
- a way to show a line of text (ambiguity, warnings)
- optionally: ask a question; run a model (to answer sampling)
Per harness, research which of these exist and how, before writing any code. Where a harness only supports MCP servers (no plugin API), mcpx-as-MCP-server is the adapter, and the session id should come from request _meta where the harness provides one.
No real choice on the shape (core + thin adapters, with mcpx-as-MCP-server as the adapter of last resort); the work is the per-harness research, and it should precede any move of files.
Ease · Impact · Related
Ease M (research per harness, then extract the core and lift the Bun fetch assumption) · Impact med — one adapter per harness, each small once the core is portable.
Related: #47 (opencode v2 is the first new adapter), #80 (a plugin's /v1 back-channel is the same client), #84 (the Go /v1 client is this core's twin).
Security/auth deferred; see tracker.
Activity
developing-today commentedon Oct 28, 2026
CODE-788
dezren39 commentedon Oct 28, 2026
History carried over from dezren39/darwin-nix#48 (verbatim, oldest first):
@dezren39 · 2026-09-30T07:28:41Z
Integration pass. This issue has no category tracker -- it predates the build-out and is a dependency of several parts of it. Placed in the proposed order at #181.
@dezren39 · 2026-09-30T12:12:03Z
Issues pass (2026-09-30, at 05c78b2).
Parent: #181, a footer (Ease M, Impact med) and Related links.daemon.ts:34-38says it imports nothing from opencode, and it needs no binary: rung 4 spawn is the last fallback (chore(deps): bump build/buck/preludes/buck2-prelude fromd956689to880be56#53,plugin/opencode/README.md:83-110).fetch({ unix })(daemon.ts:335-352). A Node-hosted harness needsnode:httpwith asocketPath.plugin/core/or new adapter. "No real choice" on shape; per-harness research comes first, so added theresearchlabel.@dezren39 · 2026-10-28T20:42:00Z
Triage verdict (lane A, task 2041, 2026-10-28): CONFIRMED at current HEAD — not yet built, trigger condition unmet, routed code-side; kept open under #181.
Evidence (owning repo developing-today/code @ bfcfc15; the mcpx source left dezren39/nix on 2026-10-19, #468):
pkgs/mcpx/plugin/contains onlyopencode/— there is noplugin/core/directory and no adapter for codex, claude code, pi, or manus (the only codex/claude artifacts areskills/mcpx-codex/SKILL.mdandskills/mcpx-claude/SKILL.mddocs, not plugin adapters).pkgs/mcpx/plugin/opencode/mcpx/daemon.tsstill carries its Portability header ("Nothing here imports from opencode …mcpx-session.tsis opencode's adapter; this file is the part that ports") — un-moved.plugin/core/") has not triggered: no second harness adapter exists yet.Routing: no follow-up packet — this is design/backlog work (labelled research), not a
small_fix, and the code lives in developing-today/code; backlog re-homing is tracked by #309 (OPEN). No counterpart for #48 exists there yet, so #48 stays open under tracker #181.dezren39 commentedon Oct 29, 2026
🤖 Agent note · picked up
dezren39 commentedon Oct 29, 2026
Triage verdict — CONFIRMED, not a duplicate, scope partly already landed (queue task 2750)
Checked against current
mainat42796be5(2026-10-29).What already exists (the September note in the issue is accurate):
pkgs/mcpx/plugin/contains exactly one harness directory:opencode/. Nocodex/,claude-code/,pi/, ormanus/adapter exists.plugin/opencode/mcpx/daemon.ts(1269 lines, withdaemon.test.ts/ops.test.ts) states the design intent in its own header (daemon.ts:37): "codex, claude, pi and manus, each of which will bring its own thin adapter."plugin/opencode/mcpx-session.ts(791 lines) is still opencode-shaped (it is the opencode session plugin), andmcpx-tui.tsxis opencode-only by nature. The env-var session bridge already landed (mcpx: take the pool's session key from the request (_meta["ai.opencode/sessionID"]), not the daemon's pid #1932's_metawork is the related session-identity substrate).Dedupe (searched 2026-10-29): no duplicate. Closest issues are different axes, not this work:
Rescope (what remains, in order):
mcpx-session.ts(session identity, env bridge, tool-timing/log hooks) behind a small harness-adapter interface; the opencode plugin becomes a thin adapter over it, asdaemon.tsalready is for the daemon client.Follow-up: enqueued as a queue task (design/scope for step 1+2, producing pinned per-adapter implementation packets). Verification for follow-ups:
pkgs/mcpxplugin tests (bun testinplugin/opencode/mcpx) andgo test ./...via CI for any daemon-side change.🤖 Agent note · done (triage)
dezren39 commentedon Oct 29, 2026
Follow-up from the triage above: enqueued as queue task 3080 — "mcpx: harness-free session core extraction + first non-opencode adapter — design/scope follow-up to #1861". Labels updated to mirror that queued follow-up.
318 remaining items
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: handed_off
Lane code-c claimed task 3692 (small_fix, attempt 18/24) and assigned it to the opencode execution lane per repo-queue lane assignment. Checkpointed handed_off — the opencode claimant launches the bound session to drive task 3692 to a terminal state; this lane does not work it directly.
Fresh verification: issue #1861 OPEN, no hard-stop labels. Prior progress preserved: branch queue/3692-1861-plugin-core-v1-v2, worktree /home/user/git/fleet/3692, partial extraction staged (imports/generator/test-runner refs not yet updated — do not treat the partial state as green). Stale parked labels synced to queue/claimed + status/in-progress.
dezren39 commentedon Nov 4, 2026
agent-note:v1
event: picked_up
queue: repo-health-code-pilot
task: 3692 (small_fix, worker repo-worker-code, lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
by: openchamber-scheduled-lane
at: 2026-11-04T18:05Z
fresh_evidence: #1861 is OPEN with no hard-stop labels; #2489 and #2457 are MERGED; open-PR search for 1861 returned none. Resuming existing branch queue/3692-1861-plugin-core-v1-v2 and worktree /home/user/git/fleet/3692 from its checkpoint. Next: inspect exact staged state and resume only if the worktree still matches the preserved partial extraction.
dezren39 commentedon Nov 4, 2026
agent-note:v1
event: parked
queue: repo-health-code-pilot
task: 3692 (small_fix, worker repo-worker-code, lane aea12c82-c5af-4e5a-9b66-f8e360f87177)
by: openchamber-scheduled-lane
at: 2026-11-04T18:19:19Z
state: Parked for 20 minutes; queue task is terminally parked and labels are synced (
queue/parked,status/parked;work/assignedretained).fresh_evidence: #1861 OPEN; #2489/#2457 MERGED; open search for #1861 returned none. On untouched current main, v1 Bun suite 53 pass/5 skip, v2 suite 38 pass,
TestThePluginReadsNoUndeclaredSettingpasses;TestNoUndeclaredEnvReadretains the packet-disclosed unrelated failure atinternal/daemon/routes_settings.go:950forMCPX_ADAPTER_DECLARATION_SHA256.progress: preserved branch
queue/3692-1861-plugin-core-v1-v2, worktree/home/user/git/fleet/3692, latest-main merge atcc5cdff74; WIP commit41bc65952moves the four daemon/ops files unchanged intoplugin/core. No other implementation changes or PR. Primary clone main is current; its three untracked local scripts were preserved.disposition: this scheduled lane cannot safely complete the two-adapter extraction plus generator, parity, mirror, and CI/test-runner updates within its remaining window. Read-only map confirms
truthyis the strongest shared pure helper candidate; keep differing v1/v2 timing, instruction hooks, and host environment projections adapter-local.resume: full 45-minute lane; continue this exact branch/worktree, update imports and generator/test-runner references, extract demonstrably shared helpers while preserving adapter behavior, add core helper tests, run both Bun suites and Go guard, then open PR. Do not treat the partial branch as green.
dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 4, 2026
agent-note:v1
event: handed_off
task: 3692
lane: code-i
execution_lane: opencode
summary: Task 3692 (small_fix for #1861, two-adapter plugin core extraction) claimed by lane code-i and assigned to the opencode execution lane. Fresh check: issue #1861 OPEN; labels already queue/claimed + work/assigned + status/in-progress. Attempts 23/24 CAP RISK. Resume — do not restart — in laptop worktree /home/user/git/fleet/3692 on branch queue/3692-1861-plugin-core-v1-v2 (staged four-file move into plugin/core; imports/generator/test-runner refs next; partial state is not green).
next: claimant launches the bound opencode session for task 3692
dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off