Verified Solution

[microsoft/vscode] Copilot chat OTel includes system instruction in message JSON

Sponsored Content
### ROOT CAUSE The system instruction is being duplicated in the trace data because it is included in both the input messages and the system instructions. This duplication occurs due to the way the messages are structured in the JSON payload sent to the OpenTelemetry (OTel) exporter. The system instruction is present in two different fields, causing it to appear twice in the Aspire dashboard. ### CODE FIX To fix this, we need to modify the code that constructs the message JSON for OTel tracing. Specifically, the system instruction should only be included in the `system_instruction` field and not in the `messages` array. Here's the fix: 1. **Locate the code** where the messages are being prepared for OTel tracing (likely in the `vscode-copilot` extension or similar). 2. **Modify the message structure** to remove the system instruction from the `messages` array and include it only in the `system_instruction` field. Example change (pseudocode): ```typescript // Before const messages = [ { role: 'system', content: systemInstruction }, ...otherMessages ]; // After const messages = [ ...otherMessages // Remove system instruction from here ]; const traceData = { ...traceData, system_instruction: systemInstruction // Add it here }; ``` This ensures the system instruction is only included in the `system_instruction` field, preventing duplication. The exact implementation may vary based on the existing code structure, but the principle is to separate the system instruction from the regular messages.
Deploy on DigitalOcean ($200 Credit)

Related Fixes

[rust-lang/rust] Tracking Issue for `stdarch_aarch64_rand`
[StackOverflow/docker] Run redis docker container from Dockerfile with authentication
[StackOverflow/docker] How to checkout a branch when all branches are already checked out at '<current_working_tree>'