Skip to content

Add AIC to agent debug panel#315133

Merged
pwang347 merged 3 commits intomainfrom
pawang/debugPanelAIC
May 8, 2026
Merged

Add AIC to agent debug panel#315133
pwang347 merged 3 commits intomainfrom
pawang/debugPanelAIC

Conversation

@pwang347
Copy link
Copy Markdown
Member

@pwang347 pwang347 commented May 7, 2026

Copilot AI review requested due to automatic review settings May 7, 2026 23:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR plumbs Copilot per-request usage credits (from copilot_usage.total_nano_aiu) through the chat debug event pipeline and surfaces an aggregated “Copilot Usage (AIC)” metric in the Agent Debug Logs overview.

Changes:

  • Extend chat debug “model turn” events (proposed API + internal DTOs) with copilotUsageNanoAiu.
  • Emit and persist the copilot_usage.total_nano_aiu value from Copilot OTel spans/debug logs into chat debug model turn events.
  • Display total Copilot usage (converted to AIC) in the Chat Debug Overview “Summary” metrics.
Show a summary per file
File Description
src/vscode-dts/vscode.proposed.chatDebug.d.ts Adds copilotUsageNanoAiu to the proposed ChatDebugModelTurnEvent API surface.
src/vs/workbench/contrib/chat/common/chatDebugService.ts Extends internal model-turn debug event type with copilotUsageNanoAiu.
src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.ts Aggregates nano-AIU usage and conditionally renders “Copilot Usage (AIC)” in the overview metrics.
src/vs/workbench/api/common/extHostTypes.ts Adds copilotUsageNanoAiu to the extension-host type wrapper for model turn events.
src/vs/workbench/api/common/extHostChatDebug.ts Serializes/deserializes copilotUsageNanoAiu between ext host objects and DTOs.
src/vs/workbench/api/common/extHost.protocol.ts Extends the model-turn event DTO with copilotUsageNanoAiu.
src/vs/workbench/api/browser/mainThreadChatDebug.ts Forwards copilotUsageNanoAiu through main-thread event serialization and revival.
extensions/copilot/src/platform/otel/common/genAiAttributes.ts Introduces an OTel attribute key for copilot_usage.total_nano_aiu.
extensions/copilot/src/extension/trajectory/vscode-node/otelSpanToChatDebugEvent.ts Maps the new OTel attribute into vscode.ChatDebugModelTurnEvent.copilotUsageNanoAiu.
extensions/copilot/src/extension/prompt/node/chatMLFetcher.ts Attaches copilot_usage.total_nano_aiu onto inference spans as an attribute.
extensions/copilot/src/extension/chat/vscode-node/chatDebugFileLoggerService.ts Includes copilotUsageNanoAiu when logging spans to the debug log file format.

Copilot's findings

  • Files reviewed: 10/11 changed files
  • Comments generated: 1

@pwang347 pwang347 changed the title Add AIC to debug panel Add AIC to agent debug panel May 8, 2026
@pwang347 pwang347 marked this pull request as ready for review May 8, 2026 03:29
@pwang347 pwang347 enabled auto-merge (squash) May 8, 2026 03:30
@pwang347 pwang347 merged commit a8af3bc into main May 8, 2026
27 checks passed
@pwang347 pwang347 deleted the pawang/debugPanelAIC branch May 8, 2026 04:26
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 8, 2026
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.

Show AI credits used in Agent Debug logs

3 participants