SIGN IN SIGN UP

feat(otel): cover the rest of OpenCode's hook and event surface (#87)

Raises coverage from 5 hooks / 11 events to 5 hooks / 16 events, and
fixes three defects the first cut left behind.

Fixes:

- service.version and vcs.repository.ref.name were documented resource
  attributes that could never appear. OpenCode reveals both only as
  events, which arrive after the OTel Resource is fixed at provider
  construction. Both are now deferred promise-valued resource
  attributes, bounded by a timeout so a host that never emits them
  cannot block export forever. Exit handlers abandon still-pending
  attributes before draining — their timers are unref'd, so on
  beforeExit they would otherwise never fire and hang the final flush.
- permission.replied only fires for prompts a human answered, so a
  config that auto-allows tools reported no decisions at all.
  permission.ask now counts auto-decisions; the two paths are
  distinguished by opencode.permission.source and cannot double-count.
- Per-session bookkeeping was never pruned. Message and tool state is
  dropped at session.idle, everything at session.deleted. The
  cumulative-diff memory deliberately survives an idle, or a resuming
  session would re-count its whole diff.

Added: chat.params (sampling parameters, and a chat span that opens
before the provider request — which is what makes trace propagation work
for the first request of a turn), experimental.text.complete (response
size), experimental.compaction.autocontinue (overflow), and the
installation.updated, vcs.branch.updated, todo.updated, session.deleted
and server.instance.disposed events.

Everything still excluded is documented with its reason, including
lsp.client.diagnostics, whose payload carries no severity or counts.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
S
Stephane SEGNING LAMBOU committed
dc114343ea7ffd530e3b3baadbf932bed9cc1c38
Parent: e938787
Committed by GitHub <noreply@github.com> on 8/14/2026, 12:02:07 PM