Repository navigation
2026-99: fix(harness-adapters): restore OpenCode v2 plugin loading - #99
Merged
Merged
Conversation
Owner
Author
Scope limitation (captain-recorded)PR #99 restores OpenCode v2 plugin loading. It does NOT restore watcher continuity. Observed OpenCode v2 runtime emits no Watcher lifecycle remediation is tracked separately through the OpenCodeLifecycleAdapter follow-up.
This PR must not be recorded as resolving the OpenCode v2 watcher issue. |
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
* fix(opencode): port firstmate plugins to v2 * no-mistakes(review): Normalize v2 event payloads for plugin handlers * no-mistakes(test): Cover v2 event payloads in plugin contract tests * no-mistakes(document): Document OpenCode v2 primary plugin contract
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
* fix(opencode): port firstmate plugins to v2 * no-mistakes(review): Normalize v2 event payloads for plugin handlers * no-mistakes(test): Cover v2 event payloads in plugin contract tests * no-mistakes(document): Document OpenCode v2 primary plugin contract
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.
Intent
이거 자꾸 뚝뚝 끊기는데 그냥 워쳐로 계속 감시할 순 없어?
조치해
Root cause found (2026-10-07, read-only): on opencode v2.0.18 every firstmate opencode plugin fails to load, so watcher arming, the session-start nudge, the turn-end guard, and the pretool seatbelt are all inert.
~/.local/share/opencode/log/opencode.logshows for all five:failed to load plugin ... PluginModule.LoadError: Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))Affected (tracked,
.opencode/plugins/):fm-primary-cd-check.js,fm-primary-pretool-check.js,fm-primary-sessionstart-nudge.js,fm-primary-turnend-guard.js,fm-primary-watch-arm.js. That is why supervision kept cutting off (no auto-rearm) and required manual prompts.What Changed
idandsetupexports to all five primary plugins, adapting v2 tool hooks and event subscriptions to the existing handlers.Risk Assessment
✅ Low: The v2 entrypoints and event payload adapters match the repository’s existing v2 plugin patterns and preserve the intended watcher and guard behavior.
Testing
A focused contract test passed, and live startup loaded all five plugins without logged load errors. The event-handler scenario was not driven against the live product.
PluginModule.LoadError.loading pluginentriessession.createdandsession.idlev2 payloads; nudge, turn-end, and watcher handlers receive their session IDs.Evidence: OpenCode v2.0.18 plugin load log
Source: OpenCode v2.0.18 plugin load log
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
.opencode/plugins/fm-primary-watch-arm.js:516- The v2 subscription passes each event unchanged, but the handlers still read v1event.propertiesfields. OpenCode v2 plugins in this repo read payloads fromevent.data(for examplebin/fm-spawn.sh:4284). A concretesession.idleevent withdata.sessionIDtherefore reachesensureArmwith no session ID, so watcher arming remains inert;session.createdalso misses its nudge. Apply the v2 event shape at the shared adapter. Same mismatch:.opencode/plugins/fm-primary-sessionstart-nudge.js:81(session.createdID),.opencode/plugins/fm-primary-turnend-guard.js:118(idle session ID),.opencode/plugins/fm-primary-watch-arm.js:516(passes raw event).🔧 Fix applied.
✅ Re-checked - no issues remain.
servewith isolated HOME/XDG directories and querying its health endpoint. The server started, but did not discover project-local plugins because the worktree has no…opencode --versionStarted OpenCode v2.0.18servewith isolated HOME/XDG directories and queried its health endpoint; server started without discovering the project plugins.bash tests/fm-opencode-v2-plugin-contract.test.shRemoved disposable probe directories from the worktree.🔧 Fix applied.
1 warning still open:
session.createdandsession.idlev2 payloads; nudge, turn-end, and watcher handlers receive their session IDs.PluginModule.LoadError.loading pluginentriessession.createdandsession.idlev2 payloads; nudge, turn-end, and watcher handlers receive their session IDs.tests/fm-opencode-v2-plugin-contract.test.shStarted OpenCode v2.0.18 with isolatedHOME, XDG config/data, and Firstmate state; captured plugin load log.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.