fix(trace): record the skills of OpenCode 2 sessions

Merged
JI
2d ago
+79-26

Fixes #3660.

The OpenCode provider of Chainloop Trace read the skill tool call in the OpenCode 1.x shape only, so an OpenCode 2 session recorded no skill and no copy of it.

  • The session export reader takes the skill name from the id input field (OpenCode 2) when there is no name field (OpenCode 1.x), and the skill folder from the directory metadata field when there is no dir field.
  • The plugin finds the skill folder in the directory metadata field and in the text items of an OpenCode 2 tool result, so the hook after the skill tool sends the folder and the push stores a copy of the skill. A plugin installed by an earlier version must be installed again.
  • The Trace README tells about the reinstall.

The end-to-end suite (spec issue-3635) found the problem. With this fix, its "Skills tracking" cell for OpenCode 2 passes in 3 of 3 runs (it was 0 of 3).

AI disclosure: Claude Code helped to write this change.