fix: update plugin for OpenCode 1.16.0+ compatibility and add schema migration#527
fix: update plugin for OpenCode 1.16.0+ compatibility and add schema migration#527High-cla wants to merge 2 commits into
Conversation
- Tests database path detection - Verifies PRAGMA schema inspection - Confirms no-op when seq already has DEFAULT 0 - Validates graceful failure on missing binary
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/27087761913 Artifacts expire in 7 days. |
|
Hi @High-cla Thanks for the PR. I have made some fixes in dev for the 1.16+ support. Can you check if that works for you |
|
Thanks @High-cla For the OpenCode 1.16+ compatibility concern, I’m not sure there is still an issue to fix here. Issue #525 appears to have been addressed by #526 (“Support OpenCode SDK 1.16 runtime APIs”), and there is also feedback on #525 saying OpenCode v1.16.2 works fine. Before keeping any plugin compatibility changes, could you provide a fresh repro/evidence for what is still broken on current If there is still a real plugin-specific regression, I think you should narrow the PR to it. |
|
Also as per my investigation, there aren't any changes needed to plugin too. |
|
Please re-open this if you feel otherwise. |
Summary
Fixes two compatibility issues between CodeNomad and OpenCode v1.16.0+:
Issue #525 — Plugin Compatibility with OpenCode 1.16.0+
Changes:
packages/opencode-plugin/package.json: Bumped@opencode-ai/pluginfrom1.3.7to^1.16.0and added the"oc-plugin"field for npm plugin discoverypackages/opencode-plugin/plugin/codenomad.ts: Updated to the newPlugintype from@opencode-ai/plugin, replaced the oldchat.messagehook withexperimental.chat.system.transform, and addedexport const server: Pluginfor the PluginModule format (required by the v1.16+ loader)packages/opencode-plugin/plugin/lib/background-process.ts: Changedtoolimport from@opencode-ai/plugin/toolto@opencode-ai/plugin(tool is now re-exported from the main entry)Issue #31204 —
session_message.seqNOT NULL Constraint FailureChanges:
packages/server/src/workspaces/migration.ts(new): Non-blocking schema migration utility that checks the OpenCode database and fixes theseqcolumn if neededpackages/server/src/workspaces/runtime.ts: CallscheckAndFixOpencodeSchema()before spawning OpenCode instancesThe migration handles three cases:
ALTER TABLE ADD COLUMN seq INTEGER NOT NULL DEFAULT 0Testing
tsc --noEmiton both packages: Zero errorsopencode dbcommand (no external dependencies)