diff options
| author | GoldJohnKing <GoldJohnKing@live.cn> | 2026-09-16 20:35:08 +0800 |
|---|---|---|
| committer | GoldJohnKing <GoldJohnKing@live.cn> | 2026-09-16 20:35:08 +0800 |
| commit | 07f9d6f6fc881c1c78b04915de96557c1caf73da (patch) | |
| tree | 051523f7465cafe6c4b431540d00d1bc9f3d5b83 /docs/README.opencode.md | |
| parent | 4996eb00bdcfad114c09610cc8b5737eb1a9f0e6 (diff) | |
fix(opencode): register skills with Skill.Info 2.0.4 path field; contain per-skill add failures
Reported on PR #2106 (80avin): on OpenCode v2.0.4 the plugin is disabled
at startup with "Plugin disabled after skill.transform failed", losing
both skill registration and bootstrap injection.
Root cause: upstream commit 199aabe9e2 (first released in v2.0.4)
renamed Skill.Info's required file field `location` -> `path` and removed
`slash`. draft.add() decodes payloads with Schema.decodeUnknownSync
against that schema, so our `location` payloads now fail decode with
"Missing key path".
Why the failure was silent: the decode error is thrown during the host's
state rebuild, where the State layer catches it and hard-disables the
whole plugin group asynchronously - the throw never reaches the
try/catch around ctx.skill.transform(), and the session "context" hook
is torn down as collateral.
Fix:
- skill payloads now use `path` (2.0.4 contract); no v2.0.3 compatibility
retained per review decision
- draft.add() failures are contained per skill inside the transform
callback, so one rejected payload skips that skill (visible in server
logs) instead of the host disabling the entire plugin
- new test-skill-registration unit test pins the 2.0.4 payload contract
(absolute path field, no stale location/slash, hostile-add containment)
and is registered in run-tests.sh; full suite 3/3 green
Diffstat (limited to 'docs/README.opencode.md')
0 files changed, 0 insertions, 0 deletions
