@raindrop-ai/opencode-plugin
v0.0.15
Published
Raindrop observability plugin for OpenCode — automatic session/event/span tracing
Keywords
Readme
@raindrop-ai/opencode-plugin
Raindrop observability plugin for OpenCode with automatic session, event, and span tracing.
Install
pnpm add @raindrop-ai/opencode-plugin @opencode-ai/pluginIf your integration also uses the OpenCode SDK directly, install @opencode-ai/sdk as well.
Payload size limits
Text fields (event input/output, span prompt/response and tool payloads) are
capped at 1,000,000 characters per field and truncated with a
...[truncated by raindrop] marker. The cap is enforced before (or during)
serialization, so oversized payloads cost the cap — not the payload — on the
OpenCode host's event loop, and large events land truncated instead of being
rejected at the ingest size limit. Hook error logs are rate-limited to one
line per failure family per 30s so a persistent error can't flood the host's
output.
Correlating per-message feedback signals
Each Raindrop event uses a client-generated event_id that isn't predictable
from the outside. To let you attach a signal (e.g. a per-message thumbs
up/down) to the right event, every finalized event carries the OpenCode
assistant message id as properties.message_id (the msg_... of the turn's
final assistant message). The same id is set as the message_id attribute on
the turn's root span.
Given a msg_..., look up the event whose properties.message_id matches it,
then send its event_id to /v1/signals:
// finalized event payload (track_partial)
{
"event_id": "…", // random, generated client-side
"ai_data": { "convo_id": "ses_…" },
"properties": { "message_id": "msg_…" } // ← correlate on this
}Notes
@opencode-ai/pluginis required.@opencode-ai/sdkis an optional peer dependency.- Tests live in the nested
tests/package and validate HTTP payloads and tracing behavior.
