Trace context

Correlate a response, and the feedback that references it, back to its trace
View as Markdown

AgentResponse and PlatformFeedback both carry an optional trace context: vendor-neutral tracing metadata for a single assistant turn. Set it on your responses so a consumer can correlate any response back to its trace. The platform echoes it back on PlatformFeedback that references the response.

TraceContext

FieldTypeRequiredNotes
traceparentstringnoW3C traceparent header value for the turn.
tracestatestringnoOptional W3C tracestate header.

Attach it once per turn.

The convenience senders (sendContentChunk, sendStatusUpdate, sendTranscript) take an optional third argument to stamp responseId / traceContext on the emitted AgentResponse:

conversation.sendContentChunk(cid, { type: 'END', content: reply }, {
traceContext: { traceparent },
});

If you build on an adapter, prefer its onTraceContext hook and createTraceparent helper (see Custom adapter (Node)) rather than populating this by hand.

Trace context is additive: older SDKs and adapters keep working and do not emit or observe it until they upgrade.

Next steps