Skip to content

mcpx: a harness-free plugin core, with adapters for codex, claude code, pi, manus #1861

Open

Description

@dezren39

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.ts says so itself: "Nothing here imports from opencode … mcpx-session.ts is 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 spawns mcpx --json status only as rung 4, the last fallback (plugin/opencode/README.md:83-110; chore(deps): bump build/buck/preludes/buck2-prelude from d956689 to 880be56 #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 needs node:http with socketPath (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 of plugin/**/*.ts(x), so a plugin/core/ or a second adapter is covered without changes; every variable a new adapter honours must be declared in internal/settings/plugin.go.

What an adapter must provide — only the first two are required, everything else degrades:

  1. a directory (to resolve which daemon)
  2. a session identifier (attribution, leasing, elicitation routing)
  3. somewhere to put environment variables, or a way to wrap tool calls
  4. a hook after a tool call (timings)
  5. a way to show a line of text (ambiguity, warnings)
  6. 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

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    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).

    • Added Parent: #181, a footer (Ease M, Impact med) and Related links.
    • Checked the core claim. daemon.ts:34-38 says 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 from d956689 to 880be56 #53, plugin/opencode/README.md:83-110).
    • New portability constraint: the socket client dials through Bun's fetch({ unix }) (daemon.ts:335-352). A Node-hosted harness needs node:http with a socketPath.
    • Noted that Phase 2: delegated Manage cannot add members #171's guard already covers any plugin/core/ or new adapter. "No real choice" on shape; per-harness research comes first, so added the research label.

    @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 only opencode/ — there is no plugin/core/ directory and no adapter for codex, claude code, pi, or manus (the only codex/claude artifacts are skills/mcpx-codex/SKILL.md and skills/mcpx-claude/SKILL.md docs, not plugin adapters).
    • The would-be core still lives inside the opencode adapter: pkgs/mcpx/plugin/opencode/mcpx/daemon.ts still carries its Portability header ("Nothing here imports from opencode … mcpx-session.ts is opencode's adapter; this file is the part that ports") — un-moved.
    • The issue's own sequencing ("once a second harness exists, move it to 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.

  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  4. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 29, 2026
  5. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    Triage verdict — CONFIRMED, not a duplicate, scope partly already landed (queue task 2750)

    Checked against current main at 42796be5 (2026-10-29).

    What already exists (the September note in the issue is accurate):

    • pkgs/mcpx/plugin/ contains exactly one harness directory: opencode/. No codex/, claude-code/, pi/, or manus/ adapter exists.
    • The daemon client core is already harness-free: plugin/opencode/mcpx/daemon.ts (1269 lines, with daemon.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."
    • What is NOT extracted: the session/hook layer. plugin/opencode/mcpx-session.ts (791 lines) is still opencode-shaped (it is the opencode session plugin), and mcpx-tui.tsx is 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 _meta work 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):

    1. Extract a harness-free session core from 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, as daemon.ts already is for the daemon client.
    2. First non-opencode adapter (Codex or Claude Code — both have documented hook/MCP surfaces) as the proof of the interface.
    3. Pi and Manus adapters stay explicitly gated on their plugin/hook APIs (Manus's is unknown, as the issue itself flags) — they are research items, not silently assumed.

    Follow-up: enqueued as a queue task (design/scope for step 1+2, producing pinned per-adapter implementation packets). Verification for follow-ups: pkgs/mcpx plugin tests (bun test in plugin/opencode/mcpx) and go test ./... via CI for any daemon-side change.

    🤖 Agent note · done (triage)

    • Agent: queue worker (repo-worker-code), Lane A shift
    • Session / ID: queue task 2750
    • Task: Triage complete — verdict above; follow-up enqueued; no implementation in this task, per packet
  6. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    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.

  7. 318 remaining items

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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.

  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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.

  10. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  11. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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/assigned retained).
    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, TestThePluginReadsNoUndeclaredSetting passes; TestNoUndeclaredEnvRead retains the packet-disclosed unrelated failure at internal/daemon/routes_settings.go:950 for MCPX_ADAPTER_DECLARATION_SHA256.
    progress: preserved branch queue/3692-1861-plugin-core-v1-v2, worktree /home/user/git/fleet/3692, latest-main merge at cc5cdff74; WIP commit 41bc65952 moves the four daemon/ops files unchanged into plugin/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 truthy is 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.

  12. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  13. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  14. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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

  15. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestqueue/claimedQueue worker lifecycle statesource/creatorFiled by the new-issue-creator jobstatus/in-progressQueue worker lifecycle statetask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions