Skip to content

[QUESTION] How can we debug agent code (tools) in VS Code given ADK's compilation process? #77

@ipeychev

Description

@ipeychev

Hello,

We are trying to figure out how to attach a debugger (VS Code) to our agent's code when running via the ADK.

The Issue: We can successfully attach a debugger to the main process, but we cannot hit breakpoints inside our specific Agent code (e.g., inside our custom tools).

It appears that npx @google/adk-devtools run compiles/bundles the agent code into a single file in a temporary directory before execution. Because of this, VS Code cannot map our local .ts source files to the running code, and breakpoints appear "unbound" (grayed out).

Question:
Is there a flag or configuration to:

  1. Disable this compilation/bundling during development (run TypeScript directly)?
  2. Or, ensure Source Maps are generated and pointed correctly so VS Code can recognize the original files?

More info:

  • Command used: npx @google/adk-devtools run agent.ts (or npx @google/adk-devtools web agent.ts)
  • VSCode debug configuration:
{
      "name": "Debug: ADK agent",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "npx",
      "runtimeArgs": ["@google/adk-devtools", "run", "./src/agent.ts"],
      "console": "integratedTerminal",
      "skipFiles": ["<node_internals>/**"]
    }
  • Goal: Step-through debugging of tool logic in VS Code.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions