Repository navigation
tools: add Go debug session tools via Delve - #282
Merged
Merged
Conversation
yottadynamics
force-pushed
the
go-debug-session-tools
branch
from
September 1, 2026 02:09
5dda840 to
76a963b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 daponly, resolved fromPATH, with one live debug session per yottacode session.debug_startanddebug_evalstay 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— passGOMAXPROCS=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'— passGOMAXPROCS=1 /usr/local/go/bin/go vet ./internal/dap ./internal/agent ./internal/agentruntime— passlsp_changed_files_diagnostics— cleanChecklist
go test ./...passes in CIgo vet ./...is clean for changed packagesgovulncheck ./...reports no reachable vulnerabilitiesdocs/guide)