You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: propagate outgoing trace context to spawned tool subprocesses #27031
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When OpenCode spawns tool subprocesses (shell tool, stdio MCP transports, LSP servers, formatter, git, etc.), it does not propagate the active OTel context. Tools that emit their own telemetry land in disconnected root traces, breaking continuity between the OpenCode invocation and the work the tool performed.
Expected behavior
When OpenCode spawns a tool subprocess, the OTel context active at spawn time should be propagated via the standard TRACEPARENT (and TRACESTATE when non-empty) env vars, per the OTel environment variable carrier spec. Tool subprocesses that emit OTel-instrumented telemetry should appear as children of opencode's invocation trace.
All Effect-based spawner.spawn callers (LSP servers, git/worktree, format, snapshot, project, etc.) — these route through packages/core/src/cross-spawn-spawner.ts, so a single injection point there covers them all.
Related
Sibling to #18801, which covers the inbound direction (extracting traceparent from incoming HTTP requests). Together they close the loop on trace context propagation across opencode's process boundaries
This is also worth testing as a trace-continuity contract.
A fixture can start one OpenCode turn, spawn shell plus stdio MCP plus one shared spawner.spawn caller, and assert each child process sees the same TRACEPARENT lineage. Store spawn site, child pid, propagated traceparent, parent span id, and whether the child emitted a linked span. That gives a concrete failure when one subprocess path drops context.
Activity
Necmttn commentedon Jun 22, 2026
This is also worth testing as a trace-continuity contract.
A fixture can start one OpenCode turn, spawn shell plus stdio MCP plus one shared
spawner.spawncaller, and assert each child process sees the sameTRACEPARENTlineage. Store spawn site, child pid, propagated traceparent, parent span id, and whether the child emitted a linked span. That gives a concrete failure when one subprocess path drops context.Generated with ax - https://github.com/Necmttn/ax
github-actions commentedon Aug 22, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.