feat(cli): show the trace welcome message and session link in opencode

Closed
MI
2mo ago
+458-151

First step to bring OpenCode trace support up to the level of Claude Code. This adds the two messages meant for the user, on OpenCode 1.x and OpenCode 2: the welcome message at session start, which tells that Chainloop records the session and where the evidence goes, and the link to the attested session after a push.

OpenCode defines no hook response of its own, so the hook writes one JSON response that the generated plugin reads.

  • OpenCode 1.x shows both messages as a TUI toast, and adds the session link to the shell output, so the model repeats it in its reply.
  • An OpenCode 2 plugin has no toast. The welcome message is the description of the synthetic message that already carries the spec capture instruction, which the TUI shows in the transcript. The session link is a content part of the shell result, which the TUI shows in the command block and the model reads.

Other changes in the shared layer:

  • The blank lines that frame the welcome message in Claude Code move into the Claude provider, since other agents frame it themselves. What Claude Code shows does not change.
  • The instruction that asks the model to repeat a message is one shared constant.
  • The dashboard lookup for the welcome message runs alongside session tracking, so the two waits do not add up at session start.

The feature table in app/cli/internal/trace/README.md is updated. Later steps will bring the other features (spec source pointers, pasted image pointers, and so on) to OpenCode.

This pull request was produced with AI assistance (Claude Code). The commit carries an Assisted-by trailer.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri