feat(trace): e2e adapter for OpenCode 2
Merged
JI
2d ago+595+595+012345678901234567890123456789-30-30-01234567890123456789
Part of #3635 (spec issue-3635). Adds the OpenCode 2 column to the Chainloop Trace end-to-end suite.
- An OpenCode adapter runs
opencode run --standalonewith the JSON output and auto-approved tools. Each session gets a private server, because the shared background server keeps the environment and the plugins of the folder that started it. - OpenCode takes its project folder from
PWD, not from the working folder of the process. The adapter setsPWDto the workspace. As a guard, the suite now fails when the HEAD of the checkout that runs it changes during a run. - The Trace plugin posts the instruction and the reminder to the session as synthetic messages. The adapter exports the session after the run and reads them from the export.
- The suite runs the harnesses that
config.yamllists. OpenCode 2 is pinned to 2.0.22 withopenrouter/anthropic/claude-haiku-5.5, which needsOPENROUTER_API_KEY. The adapter returns an error when the installed major version is not the one of the column. OpenCode 1.x is not configured yet. - The harness gives the path of the skill files, and the file of the user hook when it is not the file of the Chainloop hooks. For OpenCode, the Chainloop plugin and the user plugin are separate files.
- The check of allow markers reports "not covered" when the stored session holds no copy of the fixture line: the OpenCode transcript has no tool outputs.
- The model check accepts a provider prefix in the configured model name.
- The ticket prompt asks for the file tool and a separate commit command, and the media prompt tells the agent not to capture the image. Without this, some runs tested the model's choices, not the feature.
- The README marks the OpenCode 2 cells that the suite verified as Yes: hook installation and deletion, trace run wrapper, missed session start, and spec source role, title, and description.
AI disclosure: Claude Code helped to write this change.