Skip to content

tools: add Go debug session tools via Delve - #282

Merged
yottadynamics merged 4 commits into
mainfrom
go-debug-session-tools
Sep 1, 2026
Merged

yottadynamics merged 4 commits into
mainfrom
go-debug-session-tools

Conversation

@yottadynamics

@yottadynamics yottadynamics commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the v1 Go debugger tool surface on top of the DAP client from PR #281. The new debug_* tools start a Delve DAP session, set breakpoints, continue/step, inspect stack and variables, evaluate expressions, and stop the session.

The implementation intentionally keeps the surface small: dlv dap only, resolved from PATH, with one live debug session per yottacode session. debug_start and debug_eval stay in the auto-mode safety floor so they always prompt for approval; the other debugger tools operate inside the already-approved debug session.

Follow-up hardening fixes the initial Delve DAP continue flow, clears ended sessions on exit/termination events, and adds registry cleanup hooks so runtime shutdown tears down a live Delve session even without explicit debug_stop.

Related issue

Stacks on #281 for Phase D / PR D2.

How was this tested?

  • /usr/local/go/bin/go test ./internal/agent -run 'TestGoDebug|TestDebugToolsApprovalPolicy|TestRegisterCoreCwdToolsRegistersGoDebugTools|TestTools_Metadata|TestIsAutoModeSafetyFloor' — pass
  • /usr/local/go/bin/go vet ./internal/agent — pass
  • GOMAXPROCS=1 /usr/local/go/bin/go test -p 1 ./internal/dap ./internal/agent ./internal/agentruntime -run 'TestClientPreservesLifecycleEventWhenEventBufferFull|TestSafeStringAllowsConcurrentWriteAndRead|TestSessionCloseDisconnectsAndKillsProcess|TestGoDebugFirstContinueAfterConfigurationWaitsWithoutContinueRequest|TestGoDebugEndedEventClearsActiveSession|TestCleanupRegistryToolsStopsGoDebugSession|TestGoDebugStartCleansUpIfContextCancelsAfterLaunch|TestGoDebugStartInitializesLaunchesAndEnforcesSingleSession|TestDebugToolsApprovalPolicy|TestRegisterCoreCwdToolsRegistersGoDebugTools|TestIsAutoModeSafetyFloor' — pass
  • GOMAXPROCS=1 /usr/local/go/bin/go vet ./internal/dap ./internal/agent ./internal/agentruntime — pass
  • lsp_changed_files_diagnostics — clean
  • GitHub Actions for this PR — pass

Checklist

  • go test ./... passes in CI
  • go vet ./... is clean for changed packages
  • govulncheck ./... reports no reachable vulnerabilities
  • Tests added or updated — a new capability ships with tests, a bug fix ships with a regression test
  • Docs updated in the same change if behavior or surface changed (relevant docs/ guide)
  • PR is focused on one logical change

Base automatically changed from dap-client-library to main September 1, 2026 20:57
@yottadynamics
yottadynamics merged commit 9f1e4a5 into main Sep 1, 2026
7 checks passed
@yottadynamics
yottadynamics deleted the go-debug-session-tools branch September 1, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant