VS Code Agent Debug Persists Sessions + New Editing UI
VS Code now persists agent debug sessions on disk for historical review and troubleshooting; new Agent app UI enables easy project edits with auto-approvals, custom hooks, and context management.
Persistent Session History Unlocks Deeper Agent Inspection
Before this update, VS Code's Agent Debug panel only captured live sessions in memory—restarting the editor wiped everything clean. VJ Upadya, principal engineer on the VS Code team, addressed this by enabling disk persistence. Now, on launch, the panel defaults to the five most recent sessions, with a "load more" option for older ones. Opening a historical session (e.g., from yesterday) reveals a timestamped tree view: top-level user messages nest sub-agents, tool calls, inputs, raw responses, and reasoning steps. Errors like failed reads surface with context from prior events.
"It's mostly I want to get a quick view of what happened in my session like what specifically what tool calls or what sub agents were invoked and then kind of a drill down into some of the specifics," VJ explained. This at-a-glance visibility helps diagnose tool failures or understand agent logic without rerunning prompts—crucial since Copilot's integration is open source, letting users trace prompt-to-tool flows.
Tradeoff: Unbounded growth risks disk bloat. Defaults cap at 50 sessions (circular buffer: oldest evicts on overflow) and 100MB per session (purges old events). Users can override via settings like agent.debug.maxSessions or agent.debug.maxSessionSizeMB for unlimited retention if disk space allows. Flush interval (agent.debug.flushIntervalMs, default 4s) balances responsiveness vs. I/O overhead.
Access via ... menu > "Show Agent Debug Logs." A single setting converges prior fragmented toggles: agent.debug.fileLogging (off by default) enables both debug visualization and troubleshooting—deprecating the old agent.debug.log.
Troubleshoot and Compare Any Past Session
Initial troubleshooting targeted only active sessions, forcing live recreation for historical issues. Now, invoke /troubleshoot in the chat with autocomplete for any persisted session (e.g., /troubleshoot @session 2024-05-20T14:30). Free-form prompts analyze failures, performance (e.g., slow model vs. tool), or summarize flows: "Why were there any tool call failures?" yielded "No critical failures. Just some sub-agent exploration."
Multi-session support shines: @session yesterday and @session now, then "compare these two sessions" highlights diffs in tools, latency, or errors. Alt method: Panel's "Add Context" > Sessions > attach, then /troubleshoot.
"If there are any tool call failures it would show up here like for example if the read were to fail it will show the reason for the error message of why it failed," VJ noted, emphasizing quick root-cause hunting over manual log dives.
Feedback loop: File issues in the VS Code repo—VJ monitors for gaps like new diagnostics.
Agent App UI Evolves Editing into Guided Workflows
Chat sessions have matured into a full Agent app (VS Code Insiders), discoverable via Copilot Chat button, vscode://agent URI, or Windows Start menu. Bridget (PM) and Follow (engineer) demoed refactoring a sad GitHub sign-in screen in a Python Flask app (compileup tracker).
Prompt with screenshot: "The sign in screen is a bit sad, not welcoming. Let's improve that." Agent browses workspace files, adds context selectively (avoids hallucinating full codebase), suggests UI tweaks. Toggle theme (dark→light), query "How do I run this project?" → auto-adds tasks.json ("run: python3 app/app.py"), spawns terminal, previews in embedded webview.
Notifications streamline: Side-panel "Allow" for tool calls (e.g., edits); bypass via settings for low-risk sessions (e.g., grok calls). File explorer integration drags context; hooks customize: session start, pre/post-tool (e.g., validate changes).
"You're able to imagine it as kind of the way to power your AI usage and be more performant, be like make the agent succeed better," Follow said. Conservative agents? Follow-up: "You forgot to do the changes of the UI." Results: Welcoming redesign without manual setup.
Evolution: Builds on prior chat (Follow presented v1 here); frequent Insiders updates mean daily discoveries. Pro tip: Stay latest—features like 3D previews or auto-terminals land iteratively.
Why These Changes: Balancing Power, Reliability, and DX
Agents amplify productivity but opacity kills trust. Persistence/troubleshooting fixes "ghost" sessions; UI shifts from chat silos to workspace-native editing (context-aware, previewable). Tradeoffs named: Storage caps prevent crashes; opt-in logging avoids perf hits; auto-approvals speed iteration but risk unvetted edits.
Open-source ethos shines: Thanks to weekly contributors (scrolled in notes); Copilot agents visualize internals for learning. Opus 4o rollout (Pro+/Enterprise) coincides—refresh for 100% access.
"We could not do this without you. VS Code is an open source project and that's very near and dear to our heart," host Olivia stressed.
Key decisions stemmed from user pain: Overwhelmed by weekly ships? Monthly recaps highlight (full notes linked). Historical limits? Configurable. UI discovery? Multi-entrypoints.
Key Takeaways
- Enable
agent.debug.fileLoggingto persist Copilot agent sessions across restarts—view last 5 historicals instantly. - Troubleshoot via
/troubleshoot @session <timestamp>for perf issues or failures; compare multiples for patterns. - Tweak storage:
agent.debug.maxSessions: 50(circular),maxSessionSizeMB: 100,flushIntervalMs: 4000—scale for long runs. - Use new Agent app (Insiders) for project edits: Screenshot+prompt, selective context, auto-tasks/terminals, bypass approvals.
- Customize agents with hooks (pre/post-tool) and notifications—iterate fast on UI/UX tweaks.
- File repo issues for gaps; update Insiders often for rolling features like embedded previews.
- Check Copilot changelogs for model rollouts (e.g., Opus 4o now live).