Explore Agentic Development - Join a GitHub Copilot Dev Day near you!
Dismiss this update
In this article, you learn how to migrate your existing AI agent projects from Local Agent Playground and Local Visualizer to Agent Inspector in AI Toolkit. Agent Inspector combines chat, workflow visualization, and debugging support into a single experience.
AI Toolkit consolidates the Local Agent Playground and Local Visualizer into a single, unified experience called Agent Inspector. This transition improves your AI agent development workflow.
Agent Inspector provides several improvements over the previous tools.
| Capability | Previous experience | Agent Inspector |
|---|---|---|
| Debugging | No integrated debugging | One-click F5 debugging with breakpoints, variable inspection, and step-through |
| Code navigation | None | Double-click workflow nodes to jump directly to source code |
| Workflow + Chat | Separate tools (Visualizer + Playground) | Unified interface with chat and visualization together |
| Production path | Manual deployment setup | Generated code uses Hosted Agent SDK, ready for Microsoft Foundry deployment |
Agent Inspector offers the following improvements over Local Agent Playground and Local Visualizer.
Unified experience: Agent Inspector combines chat and tracing into a single interface, so you no longer need to switch between separate tools.
Debugging support: Set breakpoints in your agent code, pause execution, inspect variables, and step through your workflow logic. The separate tools didn't offer these capabilities.
Copilot-assisted setup: GitHub Copilot can automatically generate the debugging configuration, endpoints, and environment setup, reducing manual configuration errors.
Code navigation: When viewing workflow execution graphs, double-click any node to immediately open the corresponding source file in your editor.
Consistent with production: The agentdev CLI and Agent Framework SDK used in Agent Inspector are the same foundation you use for deploying to Microsoft Foundry, ensuring your local development matches production behavior.
| Before (old tools) | After (Agent Inspector) |
|---|---|
Run Microsoft Foundry: Open Visualizer for Hosted Agents command |
Press F5 in VS Code |
| Enter endpoint URL manually in Local Agent Playground | Automatic, configured in launch.json |
| View traces in a separate Visualizer tab | View traces in Inspector alongside chat |
| No debugging | Full breakpoint and step-through debugging |
If your project uses the Local Visualizer (via the Microsoft Foundry extension) or the Local Agent Playground, follow these steps to migrate to Agent Inspector.
Before you start, make sure you have:
agent-framework package).Remove the previous visualizer setup code:
Agent Inspector communicates with your agent server through agent-dev-cli and doesn't require OTEL tracing. Remove the following code if you only need workflow visualization. If you want to keep using tracing features in AI Toolkit, change the port to 4317.
from agent_framework.observability import setup_observability
setup_observability(vs_code_extension_port=4319)
Use GitHub Copilot to generate the debug files, or add them manually:
Help me set up the debug environment for the workflow agent to use AI Toolkit Agent Inspector
.vscode/tasks.json and .vscode/launch.json files for you.Create or update your .vscode folder with these files:
.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Validate prerequisites",
"type": "aitk",
"command": "debug-check-prerequisites",
"args": { "portOccupancy": [5679, 8087] }
},
{
"label": "Run Agent Server",
"type": "shell",
"command": "${command:python.interpreterPath} -m debugpy --listen 127.0.0.1:5679 -m agentdev run ${file} --port 8087",
"isBackground": true,
"dependsOn": ["Validate prerequisites"],
"problemMatcher": {
"pattern": [{ "regexp": "^.*$", "file": 0, "location": 1, "message": 2 }],
"background": {
"activeOnStart": true,
"beginsPattern": ".*",
"endsPattern": "Application startup complete|running on"
}
}
},
{
"label": "Open Inspector",
"type": "shell",
"command": "echo '${input:openTestTool}'",
"presentation": { "reveal": "never" },
"dependsOn": ["Run Agent Server"]
},
{
"label": "Terminate All",
"command": "echo ${input:terminate}",
"type": "shell",
"problemMatcher": []
}
],
"inputs": [
{
"id": "openTestTool",
"type": "command",
"command": "ai-mlstudio.openTestTool",
"args": { "port": 8087 }
},
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
}
.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Agent",
"type": "debugpy",
"request": "attach",
"connect": { "host": "localhost", "port": 5679 },
"preLaunchTask": "Open Inspector",
"postDebugTask": "Terminate All"
}
]
}
Replace ${file} in tasks.json with your agent's entrypoint Python file path if you want a fixed configuration.
Install debugpy and agent-dev-cli:
pip install debugpy agent-dev-cli
| Issue | Solution |
|---|---|
| Port 8087 already in use | Check for other running agent servers and stop them first |
| Port 5679 in use | Another debug session might be running. Close it and try again |
| Breakpoints not hit | Make sure debugpy is installed and port 5679 matches in launch.json |
| API or framework errors | Agent Framework is actively evolving. Copy terminal errors into Copilot for help |
For additional questions or issues, visit the AI Toolkit GitHub repository.
In this article, you learned how to: