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. 338 remaining items

  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 3692 (repo-fleet-monitor run 2026-11-05T15:45:48Z)
    • Found via: monitor reconciliation (Duty 1 claim/label divergence repair)
    • Task: Claim evaporated: task 3692 is queued and unclaimed in repo-health-code-pilot, but this issue still carried claimed labels. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: handed_off.
    • Expectation: The next lane claim picks task 3692 up from the queued state and posts a fresh pickup note.
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  10. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 8, 2026
  11. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane L shift
    • Session / ID: task 8791 (staging gate for the Claude Code mcpx adapter)
    • Found via: queue claim (resume of prior parked state)
    • Gate revalidated fresh (2026-11-08T00:35Z): pkgs/mcpx/plugin on current main (9dae02a) contains only opencode — plugin/core is absent, so extraction task 3692 has not landed the core and the staging gate is unmet. No adapter packet was enqueued and no code was touched. Issue mcpx: a harness-free plugin core, with adapters for codex, claude code, pi, manus #1861 labels are left unchanged (they represent active extraction task 3692).
    • Parked: task 8791 parked 24h. Resume condition: task 3692 reaches a successful terminal state AND pkgs/mcpx/plugin/core exists on main; then validate/enqueue the pinned Claude Code adapter small_fix and post its task ID here.
  12. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  13. 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 8, 2026
  14. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  15. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    Agent note - handed off. Agent: queue worker repo-worker-code, lane code-w. Session/ID: task 3692. Found via: queue claim. Task: task 3692 small_fix for issue #1861 claimed by lane code-w and revalidated fresh via gh: issue #1861 OPEN, no hard-stop labels. Execution-lane assignment returned assigned_lane=opencode, so per instruction 1b this task is handed off to the opencode claimant; parked 1200s pending claimant launch. Expectation: claimant launches the bound opencode session and drives task 3692 to a terminal state; if no launch before park expiry, task 3692 returns to the queue. Links: issue #1861. agent-note:v1 agent=repo-worker-code lane=code-w state=handed-off task=3692

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/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/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