Skip to content

FEAT: opt-in trace propagation for WebSocketCopilotTarget (part of phase 6.5) - #3056

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
WatchTree-19:feat/websocket-copilot-trace
Oct 11, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
WatchTree-19:feat/websocket-copilot-trace

Conversation

@WatchTree-19

Copy link
Copy Markdown
Contributor

Second target for phase 6.5, following #2945 for LiteLLMChatTarget.

WebSocketCopilotTarget now accepts trace_config. With TargetTraceConfig(enabled=True), each send records a fresh request trace context through the shared target_trace_context path, carries its trace ID in the prompt payload's own traceId field (previously a random value equal to requestId), and sends traceparent on the WebSocket handshake. requestId stays a separate per-request value. Tracing is off by default, and a stale link on a reused request is cleared, as for the other targets.

Tests cover a fresh context per request reaching both the handshake header and the payload, tracing off by default and with enabled=False, and the link not being copied onto the response. Each fails with its part of the change removed. ruff and ty are clean, and the prompt target suite passes.

…ase 6.5)

WebSocketCopilotTarget accepts trace_config. With tracing enabled, each send
records a fresh request trace context, sends its trace ID in the prompt
payload's own traceId field, and sends traceparent on the WebSocket
handshake. Tracing stays off by default, the per-request requestId stays
separate from the trace ID, and a stale link on a reused request is cleared.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 11, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 11, 2026
Merged via the queue into microsoft:main with commit 620091f Oct 11, 2026
81 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants