GeezerVison is showing github.com — mcpx v2: daemon picker tool — closest equivalent of the TUI select (#2841 item 3) by developing-today[bot] · Pull Request #7847 · developing-today/code
Conversation
developing-today
Bot
commented
Nov 8, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What
Implements #1858 SET-REMAINDER item (3) under #2841: the mcpx OpenCode v2 daemon picker — as the closest supported equivalent of the requested TUI select(), because the pinned v2 surface cannot support a true TUI select.
Deviation evidence (pinned API)
Verified 2026-11-08 against the pinned opencode fork (~/git/opencode at ededbacbfd, @opencode/plugin version 2.0.30):
packages/plugin/src/promise/plugin.ts — the setup Context has a fixed domain list (agent, aisdk, command, credential, event, integration, mcp, messaging, model, generate, permission, plugin, provider, reference, rpc, session, shell, skill, storage, tool, vcs, websearch, worktree). There is no ui/tui/question domain, and no select/dialog/prompt method on any domain a server plugin receives. (The question tool is a built-in model tool with codemode: false, not a plugin surface.)
- The v1 picker (
mcpx-tui.tsx) works only because v1 has a separate TUI plugin realm (@opencode-ai/plugin/tui, DialogSelect). The v2 module contract ({ id, setup } / { id, effect }) has no TUI counterpart in the pin.
This deviation is also recorded on #2841 and #1858, as item (3) requires.
The equivalent: mcpx_daemon_pick
- No index → renders the picker menu: ranked candidates, the in-use daemon marked (DialogSelect's
current), each option carrying the config path that actually distinguishes daemons plus started/servers/sessions/version detail — the v1 DialogSelect options, as tool output.
- With an index → asserts
mcpx_daemon_select through the permission domain with the same payload daemon_select sends (the one interactive channel v2 server plugins have), and only a confirmed selection reaches the ctx.storage-backed apply (remember.ts), at the requested scope.
- Cancellation is a picker outcome, not an error: a rejected assert applies nothing and reports the choice unchanged. Invalid indexes, no candidates, picker errors, and a missing permission domain likewise never change the selected daemon.
picker.ts holds the host-free core (buildPickerOptions, renderPickerMenu, runPickerSelection); tools.ts wires it to discovery/applyChoice; daemon_select is unchanged.
Tests
picker.test.ts — menu options/current marking; the selection oracle is state: apply runs only after a successful assert, with exactly the picked target + scope; cancellation / invalid index / no permission domain / no candidates all leave apply uncalled.
tools.test.ts — registration gains mcpx_daemon_pick; menu render at tool level; a confirmed pick persists through stub ctx.storage (daemon:/work record holds the picked target); a cancelled pick leaves storage empty and fires no target change.
bun test plugin/opencode/v2/ — 73 pass, 0 fail (baseline on main: 61 pass).
Scope
Item (3) only. Item (5) v1 retirement is not included — it remains sequenced after item (3) lands or is waived. Items (1), (2), (4) already landed (#5122/#5170, #3018, #4997).
Refs #2841, #1858. Queue task 13615 (lane code-h).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ct (#2841 item 3)
Item (3) of the #1858 SET-REMAINDER asked for a promise-based TUI select() daemon picker persisted via ctx.storage. The pinned v2 surface cannot support a true TUI select: verified 2026-11-08 against the pinned opencode fork (ededbacbfd, @opencode/plugin 2.0.30) — the setup Context in packages/plugin/src/promise/plugin.ts has a fixed domain list with no ui/tui/question domain and no select/dialog method on any domain a server plugin receives, and the v2 module contract has no TUI counterpart to v1's separate TUI plugin realm.
Closest supported equivalent: mcpx_daemon_pick. With no index it renders the picker menu (ranked candidates, in-use daemon marked, config path + detail per option — the v1 DialogSelect options as data). With an index it asserts mcpx_daemon_select through the permission domain with daemon_select's payload, and only a confirmed selection reaches the ctx.storage-backed applyChoice. Cancellation, invalid indexes, picker errors and a missing permission domain apply nothing.
picker.ts holds the host-free core (buildPickerOptions, renderPickerMenu, runPickerSelection); tools.ts wires it to discovery/applyChoice. Tests: picker.test.ts (menu + selection oracle: apply runs only after a successful assert, with the picked target) and tool-level tests in tools.test.ts (menu render, pick persisted through stub ctx.storage, cancelled pick leaves storage untouched). bun test plugin/opencode/v2/: 73 pass, 0 fail (baseline 61).
Item (5) v1 retirement is NOT included; it remains sequenced after item (3) lands or is waived. Refs #2841, #1858.
Important
Review skipped
Bot user detected.
To trigger a single review, invoke the @coderabbitai review command.
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8918bf08-6730-47b5-97d2-0700644f6f7e
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 8, 2026
Uh oh!
There was an error while loading. Please reload this page.
|
AUDIT-7 Lane 4 review: this PR implements SET-REMAINDER item (3), the v2 daemon picker. The canonical tracker #2841 remains open for item (5), v1 file retirement; the #2841/ #1858 comments confirm item (3) landed while the remainder remains tracked. Marked audit:partial; no duplicate issue filed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
dezren39
Awaiting requested review from dezren39
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|