Skip to content

Test: Chat Agent Debug Log Panel - Copilot CLI and Claude CLI Sessions #303786

Description

Refs: #303793

Complexity: 3

Create Issue

Create Issue


Context

VS Code includes an Agent Debug Log Editor/UI — a built-in diagnostic tool for inspecting what happens behind the scenes during a Copilot chat session. Its currently OOF by default.

Enable it via the setting 'Agent Debug Log->Enabled'

Image

Then it can be opened via the chat config menu ("Show Agent Debug Logs").

Image

The UX provides:

  • Session overview — summary metrics (model turns, tool calls, token usage, errors, total events)
  • Log view — a chronological list of all debug events (tool calls, model turns, discovery events, errors) with filtering and search
  • Flow chart — a visual graph of the agent's execution flow showing how model turns, tool calls, and subagents relate to each other
  • Export/Import — sessions can be exported to OTLP JSON files for offline sharing/analysis, and previously exported files can be imported back for viewing

Prep

  • Install copilot CLI and/or Claude CLI installed if you haven't already, depending on the scenario you will be testing

  • Make sure hooks are enabled in the settings
    "chat.useHooks": true

  • Create hooks.json and save it to global hooks location at ~/.copilot/hooks. You can use hooks from (or use it as starting point and customize) https://github.com/pwang347/hooks-testing

  • Perform below steps for Copilot CLI chat session and/or Claude CLI chat sessions by picking the item from the drop down as shown below.

Image

Agent Debug Log - Basic

  • Create a Copilot CLI chat session or Claude CLI session and send few messages in chat
  • Open panel via Show Agent Logs --> panel opens with home view showing session list
  • Navigate to session --> Click a session → overview shows session details, metrics (Hooks invocation events, Model Turns, Tool Calls, Tokens, Errors, Total Events)
  • View logs — Click "View Logs" → log list shows events with timestamps, names, details.
  • View flowchart — Click "Agent Flow Chart" → flowchart renders with nodes for model turns, tool calls, subagents
  • Send a message and verify events appear — verify new events, model turn, tool calls etc appear
  • Invoke subagent (e.g. prompt : using subagent count .json files) and verify new subagent related events show up
  • Use filter text box by typing some text and make sure items are correctly filtered
  • Make sure hooks invocation events shows up, below is example for how it would look:
Image
  • Bonus: Do exploratory testing, use it on your real world session, see if its helpful to analyze your session.

Export

Image
  • Export a live session — Navigate to a session in debug panel → click Export icon (at top right corner) → save to disk → verify notification shows up, click open file and make sure itss valid JSON with resourceSpans structure

Import

  • Import a valid file — Click Import icon (at top right corner)→ select a previously exported JSON file → overview opens with correct session title, metrics

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions