GeezerVison is showing github.com — docs(mcpx): verified opencode v2 plugin facts and the core-rewrite map (#1858 groundwork) by dezren39 · Pull Request #2457 · developing-today/code
Conversation
dezren39
commented
Oct 29, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Groundwork for the mcpx → opencode v2 plugin rewrite (#1858). The core rewrite is not in this PR; this lands the API facts it depends on, checked against the pinned v2 source rather than #1858's v2-branch line references.
What this adds
pkgs/mcpx/docs/opencode-plugin-v2.md (new, 158 lines):
- Loading contract —
{ id, setup } (or { id, effect }), only default is read; a plugin directory is accepted, so the plugin/opencode/mcpx/ subdirectory workaround is unnecessary in the v2 tree.
- Context surface the port actually uses —
ctx.storage, ctx.session.hook("context") over SessionRequest.system, ctx.tool.transform + editor.namespace/add, ctx.tool.hook("execute.after") as a status union (v1 only ever saw success), and why ctx.generate / mcp.transform / permission.hook("evaluate") / the TUI picker stay out of the core (the SET-REMAINDER on mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858).
- Two corrections to mcpx: port the opencode plugin to opencode v2 (a rewrite, and several things get better) #1858's mapping table:
- the session environment route is
PUT /api/session/:id/environment (protocol/src/groups/session.ts), not /api/experimental/session/:id/environment;
- it replaces the session environment (
core/src/session/environment.ts, then core/src/shell.ts:262 falls back to process.env only when unset), so the v2 adapter must send the full environment ({ ...process.env, ...MCPX_* }) or set none — sending only MCPX_* would strip PATH and HOME from every shell command in the session.
- What the port reuses unchanged —
plugin/opencode/mcpx/daemon.ts is already harness-free, so the v2 tree imports it; only the rung-4 spawn becomes opt-in.
- Implementation map for the first slice (
v2/ tree: index.ts, options.ts, session-env.ts, context.ts, tools.ts, timing.ts, remember.ts, daemon.ts) plus the open questions for the implementer (namespace spelling, serverUrl-less embedded hosts, context-hook idempotency, settings-guard scope).
Scope discipline
Verification
- Facts re-checked by reading the pinned v2 checkout (
~/git/opencode main c9edb37fda): packages/plugin/src/promise/{plugin,tool,session,storage}.ts, packages/schema/src/tool.ts, packages/protocol/src/groups/session.ts, packages/core/src/session/environment.ts, packages/core/src/shell.ts.
- Docs only — no code path changes;
pkgs/mcpx bun/go tests unaffected (existing suite green locally: 31 pass, 4 skip, 0 fail).
Next slice on this branch: the v2/ tree itself, tests, then cd pkgs/mcpx && go test ./... via CI (includes TestThePluginReadsNoUndeclaredSetting over the new tree).
Closes nothing — #1858 stays open for the implementation.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by CodeRabbit
- Documentation
- Added a reference for the OpenCode v2 plugin API, including supported plugin shapes, context APIs, and execution status values.
- Clarified session environment update behavior and how to provide the full environment.
- Documented daemon state, optional process spawning, a proposed file layout, testing guidance, and unresolved implementation questions.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
chatgpt-codex-connector[bot] reacted with thumbs up emoji
…e map
Re-checks every v2 fact the #1858 rewrite depends on against the pinned v2
source rather than the branch the issue cited, and records two corrections to
the issue's mapping table: the session environment route is
/api/session/:id/environment, and it replaces the session environment rather
than merging it (core/src/shell.ts:262 falls back to process.env only when no
map is set), so the adapter must send the full environment.
Also maps the {id, setup} module contract, the tool.execute.after status
union, ctx.storage over the remembered-daemon file, and the file-by-file first
slice for the v2 tree at pkgs/mcpx/plugin/opencode/v2/.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-29T23:25:32.719172Z |
0e32497 |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 29, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Walkthrough
-
Adds a verified implementation map for an mcpx OpenCode v2 core rewrite. The document records plugin shapes, relevant v2 APIs, session environment behavior, daemon state handling, a proposed file layout and test approach, and unresolved questions.
Changes: OpenCode v2 plugin implementation map
| Layer / File(s) |
Summary |
Plugin contract and v2 APIs pkgs/mcpx/docs/opencode-plugin-v2.md |
Documents accepted default plugin shapes, relevant v2 context APIs, and the scope of the proposed rewrite. |
Session environment and daemon state pkgs/mcpx/docs/opencode-plugin-v2.md |
Corrects the session environment endpoint and documents its replacement behavior. Maps remembered daemon state to ctx.storage and identifies reusable daemon code. |
Proposed layout and open questions pkgs/mcpx/docs/opencode-plugin-v2.md |
Lists the proposed v2 file layout and test approach. Records unresolved questions about tool namespaces, environment-route access, context-hook idempotency, and settings guards. |
Priority: Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related issues
developing-today/code#1858 — The document verifies v2 APIs and maps the first implementation slice for the mcpx v2 rewrite.
developing-today/code#730 — The document provides a v2 compatibility assessment, but does not implement the port.
developing-today/code#1855 — The document adds the requested OpenCode v2 plugin page.
developing-today/code#1898 — The document adds an OpenCode v2 page to the plugin documentation set.
developing-today/code#1861 — The document identifies reusable daemon code and maps the v2 adapter around it.
Possibly related PRs
- developing-today/code#2195 — It records session attribution as out of scope while mapping session state to
ctx.storage; this PR changes the related session-identity contract.
Merge Risk: Low · up to 0e324
-
The proposed daemon import path needs a small correction before implementation. The documentation is otherwise mergeable with this bounded follow-up; current runtime behavior is unaffected.
Pre-merge checks: 5
-
| Check name |
Status |
Explanation |
| Description Check |
 |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check |
 |
The title names the change correctly: a documentation-only addition under pkgs/mcpx/docs that records verified opencode v2 plugin facts and a core-rewrite map. The summary and objectives both describe… |
| Docstring Coverage |
 |
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the change correctly: a documentation-only addition under pkgs/mcpx/docs that records verified opencode v2 plugin facts and a core-rewrite map. The summary and objectives both describe this as groundwork that adds one docs file, with no code-path changes. The title is specific and relates to the main change. The '(#1858 groundwork)' suffix refers to the linked issue and is accurate, though it adds some noise. The title is 89 characters, slightly over the usual short-title length, but it remains a single clear sentence.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Finishing Touches: 💡 1
-
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
- 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
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 30, 2026
This was referenced Nov 23, 2026
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.
|