Repository navigation
fix: port the OpenCode plugin to the v2 plugin API (INC-481) - #587
Merged
Merged
Conversation
… out of resume (INC-481) One default export now serves both APIs: setup(ctx) for OpenCode v2 and server() for v1 (1.3.4+). v2 reports turns from session.execution.* events and only runs on a private server, since the shared background service has another terminal's environment. Child sessions no longer report turns, a subagent's permission prompt is reported on its root session, and session-end carries the last root session id (INC-301).
…ating them as roots (INC-481)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes INC-481. The Programa OpenCode plugin now loads on both OpenCode 1.x (1.3.4 and later) and 2.x, and subagent sessions no longer mark the pane idle or become the session
programa resumereopens.Limit on OpenCode 2: by default, v2 runs plugins in one background service shared by every terminal, started with whichever terminal's environment launched it. A plugin there can't tell which pane a session belongs to, so on v2 the plugin only reports under
opencode --standalone(oropencode service set disabled true). Otherwise it stays silent rather than reporting to the wrong pane.docs/notifications.mdsays so.openCodePluginJSas one default export withserver(v1) andsetup(v2) entry points. It callsprogramathroughchild_process, one call at a time, with errors swallowed.session.execution.started/.succeeded|.failed|.interrupted,permission.asked,session.created.Verified:
node --checkpasses, and a mock v1/v2 host harness passes. Live loads ran on isolated OpenCode 1.19.5 and 2.2.7 (serve --stdio): rootprompt-submitandstopfire, the child is skipped, andsession-endcarries the root id. A plainservemakes no calls. The tagged build succeeds and the structural budgets pass.Not verified:
permission.askedwith a live provider, a real TUI exit, and sidebar status against the running app.