#339219·VS Code

Managed OTel policy changes break new chats until the Agent Host restarts

Author: rwollCreated Oct 2, 2026Updated Oct 2, 2026
Labelsbugotel

Error

Error: (sendFailed) Request session.create failed with message: Standalone managed telemetry preparation failed: Managed telemetry conflicts with the already selected OTel configuration

Summary

Changing managed telemetry policy between sessions on a running Agent Host can break new chats. We reproduced the exact error by changing only telemetry.serviceName; restarting the host with the new policy unchanged restored chat. Policy requests returned HTTP 200.

Environment

  • Reproduced: macOS, Code OSS 1.141.0 at c2f1ef2d05c, SDK 1.0.16, runtime 1.0.90.
  • Originally reported: Windows, Insiders 1.141.0 at ec2e580674cdb512aa9b2a9596ab35d8a9590f1e, same SDK/runtime. The original policy-change sequence is unverified.

Reproduction

  1. From a built VS Code checkout, start the mock server:
bash
npm run mock-policy-server
  1. Open http://127.0.0.1:3000, follow Setup > System proxy, and enable Proxyman's platform proxy. Set VS Code's http.proxy to http://localhost:9090 (Proxyman), not port 3000 (the mock server).

  2. Mock Managed Settings with HTTP 200 / JSON and the following body. Leave other endpoints on passthrough:

json
{
  "forceRemoteSettingsRefresh": false,
  "telemetry": {
    "enabled": true,
    "endpoint": "http://localhost:4319",
    "captureContent": true,
    "lockCaptureContent": true,
    "serviceName": "testtesttest"
  }
}

This disables the unrelated startup refresh gate. Use harmless prompts because content capture is enabled.

  1. Fully quit Code OSS, then launch from the checkout root with an isolated policy cache:
bash
COPILOT_CACHE_HOME="$PWD/.build/otel-repro-cache" ./scripts/code.sh --log trace

Run Developer: Sync Account Policy, then Developer: Restart Local Agent Host. Create a new Agent Host chat and send Hi. It succeeds.

  1. Change only telemetry.serviceName to testtesttest-warm-change. From the checkout root, clear only the isolated policy cache:
bash
rm -r -- .build/otel-repro-cache/managed-settings

Without syncing policy, reloading, or restarting, create another new Agent Host chat and send Hi. It fails with the exact error above.

  1. Keep the changed policy. Run Developer: Restart Local Agent Host, create a new chat, and send Hi. It succeeds again.

Scope

serviceName is the minimal verified reproduction, not a reason to scope the fix to that field. Please also cover changes to collector endpoints, headers/credentials, resource attributes, protocols, content-capture policy, and telemetry enablement. Those transitions were not individually live-tested here.

Expected behavior

Coordinate safe recovery, or offer an explicit restart-and-retry action, preserving the message and history. Recovery must continue to enforce the required exporter and privacy policy.

Version context

Related runtime PR: github/copilot-agent-runtime#22864 (repository access required).

Relevant dependency updates: #338512 adopted SDK 1.0.15-preview.4 / runtime 1.0.89-7; #339018 upgraded to the reproduced SDK 1.0.16 / runtime 1.0.90. Earlier builds were not live-tested in this reproduction.

  • Authored with GitHub Copilot on behalf of @rwoll.*