feat(tracing): propagate context to LLM providers#108
Conversation
Unable to run tests because |
|
Addressed in d755fe3. Correlation now retains multiple live LLM contexts for the same session/parent message and selects the matching context by agent, model, and provider. Completion removes only its own message context. Added coverage that invokes All local checks pass: typecheck, lint, JSDoc coverage, and 324 tests. |
|
Also folded in Validated with the repository pre-commit workflow checks and |
|
Addressed the updated Codex finding from run 30048048618 in
All checks pass, including 325 tests. |
Summary
traceparentandtracestateheaders into outbound LLM requests for explicitly configured opencode provider IDschat.headersinvocation with the liveopencode.llmspan using session, parent message, agent, model, and provider metadataOPENCODE_TRACE_PROPAGATION_PROVIDERSand the matchingtracePropagationProvidersplugin option, with explicit*wildcard supportWhy
Self-hosted gateways such as LiteLLM and vLLM can continue an incoming W3C trace, but the plugin's LLM spans and gateway spans are currently disconnected. Propagating the current
opencode.llmspan context produces one distributed trace without introducing a general-purpose outbound-header mechanism.Propagation is disabled by default. Provider IDs act as the explicit trust boundary:
Static provider-specific headers remain configurable through opencode's native
provider.options.headerssetting.Safety
Testing
bun run typecheckbun test(323 pass)bun run lintbun run check:jsdoc-coverage(85.25%)Supersedes #101.
Related to #100.