GeezerVison is showing github.com — mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec · Issue #1940 · developing-today/code
mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940DescriptionRelocated from dezren39/darwin-nix#218 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
opencode v2 wraps every MCP server in its own code mode unless the server is configured codemode: false, and this machine's v1 does the same because OPENCODE_EXPERIMENTAL is set. So mcpx's /mcp ends up as a tool called from a program the model wrote for opencode's interpreter, and nothing in mcpx's docs says to opt out. v2 also appends ?codemode=false to remote MCP URLs so servers that bundle code mode can expose raw tools; mcpx ignores it. opencode runs permission checks and plugin hooks per child call, shows live status, and cancels on abort. The plugin's mcpx_exec makes one blocking POST and ignores the abort signal (the session and field bugs are #189).
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 |
| CODE-53 |
opencode wraps MCP servers in code mode by default |
✗ — docs never tell users to opt out |
S |
| PLG-35 |
?codemode=false appended to remote MCP URLs |
✗ — neither sends nor honours it |
M |
| PLG-36 |
Hooks and permission checks per child call in code mode |
✗ — script calls bypass opencode permissions |
L |
| PLG-37 |
Live status of each child call during a script |
✗ — plugin makes one blocking POST |
S |
| PLG-38 |
Cancelling in the harness stops the script |
✗ — plugin ignores the abort signal |
S |
What to do
Document codemode: false for mcpx in opencode config; decide whether ?codemode=false should expose upstream tools flat; plumb abort and live status through the plugin's mcpx_exec.
Ease · Impact · Related
Ease M · Impact med · Related: #189, #47, #48
Acceptance criteria
- mcpx documentation tells opencode users how mcpx interacts with opencode's default code-mode wrapping, including how to opt a server out (
codemode: false) (CODE-53).
- mcpx honors
?codemode=false on its /mcp URL: raw tools are exposed instead of the code-mode surface.
- The plugin's
mcpx_exec respects the host abort signal — an aborted session cancels the in-flight call instead of blocking to completion.
- Tests cover the query-parameter handling and the abort path.
Activitydezren39 commented on Oct 28, 2026 History carried over from dezren39/darwin-nix#218 (verbatim, oldest first):
@dezren39 · 2026-10-28T04:30:23Z
🤖 Intake review — fleet monitor, 2026-10-27 run
- Related: parent tracker Phase 3: sync, blob gate, and relays #181; register rows CODE-53 / PLG-35 and neighbours in
pkgs/mcpx/docs/compare/register/; the session/field bugs in the same plugin path are Phase 4: joiner misses an update made without knowing its concurrent add #189.
- Evidence caveat: the register evidence was verified against mcpx at
05c78b2 (2026-09-30). Re-verify each row against current main before fixing — a row may have moved since.
- Still live: checked this run — no merged PR references this issue (cross-references are the register/tracker issues themselves).
- Risks: opencode v2 behavior is the moving target here — pin the tested opencode version in the tests.
- Suggested approach: docs sentence + query handling first (small, user-visible), abort-signal wiring second.
developing-today commented on Oct 28, 2026 dezren39 commented on Oct 29, 2026 dezren39 commented on Nov 17, 2026 🤖 Agent note · done (triaged)
- Agent: repo queue worker, lane code-b (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-code-b run 2026-11-16 19:28 CST; task 18177
- Task: task 18177 (triage packet, bulk intake 2026-11-16) for issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940: mcpx and opencode code mode.
- Fresh verification (2026-11-17): issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940 OPEN, carries status/triaged (triage already performed; labels also priority/normal, effort/m, app/mcpx, kind/enhancement), no held / user/owned / do-not-merge / do-not-auto-edit labels. Per runbook §1c this packet completes as triaged naming the existing record: implementation follow-on task 13061 completed 2026-11-10 — PR mcpx(plugin): thread host abort signal through mcpx_exec (PLG-38, #1940) #8089 MERGED at c9c4b27 (CODE-53 + PLG-38 remainder; CODE-53 already satisfied via mcpx docs: show the codemode:false opt-out for opencode users and correct the stale v2 caveat (CODE-53 of #1940) #7075). Issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940 deliberately stays OPEN: PLG-36 / PLG-37 remain as design-first rows outside that packet's acceptance, recorded in task 13061's completion note on this issue. No new triage performed, no duplicate follow-on enqueued.
- Links: task 18177 · issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940 · task 13061 · PR mcpx(plugin): thread host abort signal through mcpx_exec (PLG-38, #1940) #8089
dezren39 commented on Nov 17, 2026 🤖 Agent note · done (triaged)
- Agent: queue worker (repo-worker-code), Muse lane any-i
- Session / ID: task 19663 (broker follow-on of triage task 18177)
- Found via: queue claim
- Task: Follow-on packet for issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940 (mcpx and opencode code mode) — completes as
triaged: the triage of record stands and there is no scoped implementation packet to route.
- Fresh verification (2026-11-17, this lane): issue mcpx and opencode code mode: nested code mode, ?codemode=false, and what a harness expects of mcpx_exec #1940 OPEN with
status/triaged, no held / user/owned / do-not-merge / do-not-auto-edit labels. Triage task 18177 (note 6935853119) verified the completed implementation follow-on: task 13061 landed PR mcpx(plugin): thread host abort signal through mcpx_exec (PLG-38, #1940) #8089 MERGED at c9c4b27 (CODE-53 + PLG-38; CODE-53 already satisfied via mcpx docs: show the codemode:false opt-out for opencode users and correct the stale v2 caveat (CODE-53 of #1940) #7075). The issue deliberately stays OPEN for PLG-36 / PLG-37, which are design-first rows outside that packet's acceptance; the triage of record explicitly routed no duplicate follow-on, so this packet does not create one either. When PLG-36/37 are designed, they file as their own scoped issues.
dezren39 commented on Nov 24, 2026 🤖 Agent note · second pass done — closing with evidence (queue task 21777, pass 2)
Verified fresh against current main 2026-11-24: every acceptance criterion of #1940 is implemented and merged; no follow-on packet is needed.
| Row |
State |
Evidence |
| CODE-53 docs opt-out |
✅ Done |
pkgs/mcpx/docs/mcp.md:59–94 on main documents both ?codemode=false and the codemode: false opencode v2 config opt-out, with a JSON example — PR #7635 merged 2026-11-08, split issue #7075 closed |
PLG-35 ?codemode=false honoured |
✅ Done |
pkgs/mcpx/internal/mcpserver/codemode.go on main; PR #2992 merged 2026-10-31 |
| PLG-38 plugin abort |
✅ Done |
pkgs/mcpx/plugin/opencode/mcpx-session.ts:315–324, 579–594 on main — host abort signal threaded into the daemon exec call and the CLI fallback (already-aborted never spawns; mid-run abort kills the child); PR #8089 merged 2026-11-10, split issue #7076 closed 2026-11-17 |
| Tests for query handling + abort path |
✅ Done |
Covered in PRs #2992 (codemode/raw tests) and #8089 (abort-path tests) |
PLG-36 (per-child-call hooks/permissions) and PLG-37 (live status) remain design-first rows outside this issue's acceptance criteria; no scoped issues exist for them — if they are ever designed they file as their own issues. Related #1910 (plugin field/session bugs) and #1864 (daemon cancellation) are both closed.
Closing #1940 as resolved in substance.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|