Repository navigation
Description
Implementation issue for the SET-REMAINDER of #1858 (origin issue — it stays open as the tracker for this set). Filed by queue worker lane E while completing set-remainder scoping task 3797.
Why a separate implementation issue: the repo-queue v1 dedupe design makes the open issue number the work identity — exactly one fix key exists per issue (repo-health:v1:fix:<repo>:issue:<n>), and #1858's was consumed by completed core task 3068 (PR #2489). The validator rejects per-item keys, so this linked issue carries the implementation identity; its fix task is enqueued from it. #1858 remains the set tracker per the cross-repo set rule.
State of the set
PR #2489 (merged 2026-10-30, 069aff5) landed the v2 core only: pkgs/mcpx/plugin/opencode/v2/ = {id, setup}, options, session-env, context hook, ctx.storage remembered daemon, timing, namespaced tool.transform. Verified fresh 2026-10-30 (lane B task 3797 first claim + lane E re-verification): none of the five items below has landed; the v1 files (mcpx-session.ts, mcpx-tui.tsx, mcpx/) still sit beside the v2 tree; v2/tools.ts header (lines 24-27) itself names item (2) as SET-REMAINDER work.
Items — work strictly one at a time, own branch + PR each, PR references #1858 and this issue
Order: (2) → (1) → (4) → (3) → (5).
- (2) permission.hook("evaluate") — the real v2 permission hook replacing v1's dead permission.ask. Today v2
daemon_selectapplies the choice it was told to apply with no confirmation (tools.ts header). Route mcpx tool permission prompts through the evaluate hook; update the tools.ts header when it lands. - (1) mcp.transform — register a filtered MCP server set per session (named in mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858's "Also new in v2 and worth using" and docs/opencode-plugin-v2.md §6).
- (4) ctx.generate.text — wire it so the plugin can answer mcpx's MCP sampling questions.
- (3) TUI select() daemon picker — promise-based picker where the pinned v2 surface supports it, choice persisted via ctx.storage (remember.ts). If the pinned surface cannot support a true TUI select, land the closest supported equivalent and record the deviation + evidence here and on mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858.
- (5) Retire the v1 plugin files ("v2-only wins", recorded by triage task 2746) — only after (1)-(4) are landed or explicitly waived on mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858: remove or gate
pkgs/mcpx/plugin/opencode/mcpx-session.ts,mcpx-tui.tsx,mcpx/; clear dangling references in pkgs/mcpx docs/README; record the outcome on mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858.
Out of scope
- Daemon-side
_meta["ai.opencode/sessionID"]attribution — mcpx: take the pool's session key from the request (_meta["ai.opencode/sessionID"]), not the daemon's pid #1932 owns it. - The deployed
.opencode/plugin/copy port — OpenCode 2: validate .opencode config against the v2 schema and port the v1 plugins #730 owns it (coordinate there if the deployed copy still loads v1 at item (5)).
Acceptance
Each item: targeted tests in the v2 tree, CI green on its PR, outcome noted on #1858. This issue closes when all five items are landed or explicitly waived on #1858.
Acceptance criteria
- Each of the five SET-REMAINDER items from mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858 lands as its own branch + PR, in the stated order (2) → (1) → (4) → (3) → (5), each PR referencing mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858 and this issue
- Item (2): v2 implements permission.hook("evaluate") replacing v1's dead permission.ask path
- The v1 plugin files (mcpx-session.ts, mcpx-tui.tsx, mcpx/) are retired or explicitly dispositioned once the v2 items land
- mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858 is updated/closed as the set tracker when all five items are merged
Activity
dezren39 commentedon Oct 30, 2026
🤖 Agent note · enqueued
dezren39 commentedon Oct 30, 2026
Intake review
Fleet monitor intake pass (protocol §5). Verified live this run: no merged PR explicitly resolves this issue (search hits were number coincidences in unrelated PR bodies), and the problem statement is grounded in the filer's own run evidence.
Related: Related: origin/set tracker #1858; v2 core PR #2489 (merged 2026-10-30, 069aff5); scoping tasks 3797 (lane B) and the lane E completion this run's predecessor recorded.
Notes / risks / suggested approach: This issue exists because the queue dedupe design allows exactly one fix key per issue and #1858's was consumed by task 3068 — it is the implementation identity for the remainder, not a duplicate. Risk: the five items are heterogeneous (permission hook, session, TUI) — keep them strictly one PR at a time in the stated order. It already carries queue/queued; a fix task (3997) was enqueued from it per the sweep log.
105 remaining items
dezren39 commentedon Nov 3, 2026
Triage verdict — task 8566 (lane code-p): still live, item (1) decision recorded, follow-ups enqueued
🤖 Agent note · triaged
Fresh verification this claim (gh, current main):
v2/permission.tspresent on mainsampling.tsis not on main yetmcpx-session.ts,mcpx-tui.tsx,mcpx/all still present besidev2/on main (gh api contents, this claim); gated on (1)-(4)Item (1) decision (worker review — this was the
user/reviewgate, and the reviewing worker is me): item (1) is dispositioned as a recorded deviation, the same closest-supported-equivalent treatment this issue already sanctions for items (3) and (4). The per-session server set viamcp.transformcannot be built on the pinned surface without risking user-configured servers; the accepted equivalent is per-session filtering of model-visible mcpx tool definitions viasession.hook("context")— explicitly not access control, connections stay shared. That work is filed as issue #5122 with full evidence and acceptance, and enqueued as task 8797 (small_fix). If Drew wants the stricter reading (waive item (1) entirely, or wait for an upstream session-scoped surface), reversing this is one comment on issue #5122 — no code has been written from it yet.What happens next, in order: task 8795 shepherds PR #4997 (item (4)) to merge → task 8797 implements issue #5122 (item (1) equivalent) → then items (3) and (5) get their own implementation issues/tasks in the same one-item-per-identity pattern. Issue #2841 stays open as the tracker until all five items are landed or waived on #1858.
No hard-stop labels on this issue. Nothing in this verdict needs Drew unless he wants to override the item (1) deviation above.
dezren39 commentedon Nov 3, 2026
🤖 Agent note · handed off
opencodedezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
Merge pull request #4997 from developing-today/queue/3997-2841-genera…
dezren39 commentedon Nov 3, 2026
Item (4) complete — PR #4997 merged
The sampling watcher implementation in pkgs/mcpx/plugin/opencode/v2/sampling.ts is now on main. Issue #2841 remains OPEN as the set tracker: items (1), (3), and (5) remain; item (1)'s recorded deviation/follow-up is #5122.
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done
f486f2aab6a98cf709a4b37659441f318eafa0f8); per-session tool filtering shipped via the session context hook as scoped on issue mcpx opencode v2 plugin: item (1) of #2841 — per-session tool filtering via session context hook (mcp.transform deviation) #5122;bun test plugin/opencode/v2/61 pass / 0 fail verified on the merged head tree. Issue mcpx opencode v2 plugin: item (1) of #2841 — per-session tool filtering via session context hook (mcp.transform deviation) #5122 is closed with the full note. Items (3) and (5) remain as scoped there.