summaryrefslogtreecommitdiff
path: root/tests/opencode/test-plugin-loading.sh
diff options
context:
space:
mode:
authorGoldJohnKing <GoldJohnKing@live.cn>2026-08-18 20:58:47 +0800
committerGoldJohnKing <GoldJohnKing@live.cn>2026-08-18 20:58:47 +0800
commit6e31f3f7dba400468354e31de8e74d6e9729f70c (patch)
tree8e611f1d40bf0000c67b53ae7011f1ce33b144c7 /tests/opencode/test-plugin-loading.sh
parent652ff248e2571b78b03e6fe8256d8f45ffe7fe7d (diff)
fix(opencode): adapt to V2 skill draft API removal (#2106)
OpenCode V2 removed SkillDraft.source() in 1113adfd5e (#41622): the skill service now stores values only, and filesystem scanning moved to the config side. The plugin's draft.source({type:'directory'}) call threw 'draft.source is not a function', which killed the entire V2 plugin activation generation. Because V2 gates model.list on PluginSupervisor.flush (23b0688a7f, #41783), that failure left flush pending forever and the TUI showed no providers or models ('Model catalog initialization timed out', /api/model 503). Register each skills/<name>/SKILL.md as a native Skill.Info object via draft.add({id, name, description, location, content}) instead, matching the {list, add, update, remove} draft API and the pattern used by V2's built-in skill plugin. Wrap skill registration, hook registration, and the context hook callback in try/catch so a future V2 API change degrades to a logged error instead of taking down the whole generation again. session.hook('context') payload shape is unchanged and keeps working. Verified end-to-end on opencode2 v0.0.0-beta-17595: 24 skills listed via /api/skill (all superpowers skills present), /api/model returns 83 models across 3 providers, no 'failed to reload plugins' in server logs. V1 path untouched.
Diffstat (limited to 'tests/opencode/test-plugin-loading.sh')
0 files changed, 0 insertions, 0 deletions