Skip to content

Support the Debug Adapter Protocol (DAP) #372

Description

@jrothrock

Summary

Add support for the Debug Adapter Protocol (DAP) so corral can drive interactive debuggers for code running inside a sandbox. This is a feature/enhancement — nice-to-have, not urgent — but it would meaningfully level up what you can do with a sandboxed project.

Why

Today the sandbox is great for running and building code, but when something breaks the only tools are logs and print debugging. DAP is the same standardized protocol VS Code and most modern editors use to talk to debuggers (debugpy, delve, node --inspect, lldb/gdb via adapters, etc.). Speaking DAP would let us:

  • Set breakpoints, step, inspect stack frames and variables, and evaluate expressions against a process running in the sandbox.
  • Let Claude drive a debugger to diagnose a failure instead of only reading logs — e.g. "break where this panics and show me the locals."
  • Optionally surface a debug UI in the dashboard (breakpoints, call stack, variables), similar to the Live View tab.

Sketch of what's involved

  • In-sandbox adapters: ship/allow the common debug adapters in the container image (debugpy for Python, delve for Go, the node inspector, etc.), or install on demand.
  • Transport: DAP runs over a socket/stdio. The host would need a controlled channel to the adapter — respecting the one-directional trust rule (host drives the sandbox, sandbox never reaches the host control plane). Likely a docker-exec tunnel like the Live View reverse-proxy, not an inbound connection from the sandbox.
  • Session management: launch/attach a debug session, track its lifecycle alongside the project.
  • Surface: at minimum a CLI / API to start a session and issue DAP requests; optionally a dashboard "Debug" tab.

Open questions

  • Which languages/adapters to support first (Python + Go are the obvious starters given the codebase and common sandbox workloads).
  • Host-driven only, or also expose the debug session to an external editor attaching over DAP.
  • How much of a UI to build vs. just giving Claude and the CLI programmatic DAP access.

Filing as a tracking issue to scope this out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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