feat: logpoints — set_breakpoint logMessage logs without pausing (fixes #235) - #268
Merged
Conversation
…tput buffer
- set_breakpoint accepts logMessage: instead of pausing, the adapter logs
the message ({expr} interpolated with live values) as DAP output, which
lands in the per-session buffer readable via get_output and the output
resource. condition may be combined with logMessage (DAP semantics).
- New shared toSourceBreakpoint mapper feeds ALL FOUR setBreakpoints
construction sites (SessionManager live re-send, worker initial
breakpoints, connection-manager helper, js-debug handshake), killing the
field-drop bug class — this also fixes suspendPolicy being silently
dropped on the launch path (Java behavior change: launch-time
suspendPolicy is now honored).
- initialBreakpoints carry logMessage + suspendPolicy end-to-end
(proxy-config, worker interfaces, message-parser validation).
- Hybrid capability gating: AdapterPolicy.supportsLogPoints (python/js/go/
rust/mock true, java/dotnet false, ruby unknown). Known-unsupported
adapters fail fast with UnsupportedFeatureError; unknown support is
accepted with a warning and re-checked against live capabilities at
launch (drift warning annotates the stored breakpoint).
- Mock adapter simulates logpoints: advertises supportsLogPoints, retains
logMessage, and its run simulation emits output events (naive {expr}
interpolation) instead of stopping at logpoint lines.
- E2E: new language-parameterized tests/e2e/mcp-server-logpoints.test.ts —
python/javascript/go/rust/mock log without pausing (verified against real
adapters), java/dotnet reject with a clear error, ruby warns. 8/8 pass
locally. Dogfooded live: a logpoint on a Python hot loop streamed
interpolated a/b values into get_output while the program ran to
completion.
- Docs: tool-reference logpoints section + adapter support matrix,
docs/javascript/README.md's previously-phantom logMessage example is now
real, jit-diagnostics README teaches the non-breaking pattern, skill
copies + per-language references updated, CHANGELOG.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Closes #235. Builds on #267 (#236).
Logpoints are the prod-safe just-in-time diagnostics primitive: plant them at suspect lines, let the program run at full speed, and read interpolated values from
get_output— no pauses, no pre-instrumented logging. This also closes the doc–reality gap wheredocs/javascript/README.mddocumented alogMessageparameter that never existed.What's new
set_breakpointaccepts an optionallogMessage(DAPSourceBreakpoint.logMessage,{expr}interpolation). The adapter logs instead of pausing; messages flow through the existing #218/#224 output-capture path intoget_outputand thedebug://sessions/{id}/outputresource.conditioncombines withlogMessageper DAP semantics. Logpoints appear inlist_breakpointsdistinguished by theirlogMessagefield.Capability gating (hybrid, static-first). New
AdapterPolicy.supportsLogPoints(python/js/go/rust/mocktrue, java/dotnetfalse, ruby unknown):UnsupportedFeatureErrorat set time (also when live capabilities post-launch deny it).initializecapabilities at launch — mirroring the [FEATURE] Capture adapter initialize capabilities + best-effort exceptionInfo enrichment on exception stops #243 exception-filter drift pattern; a drifting logpoint gets its storedmessageannotated ("may pause instead of logging").Pipeline fix underneath: one mapper, four construction sites
There were four independent places building
setBreakpointsarrays, each mapping its own subset of fields (suspendPolicyalready demonstrated the bug class — it silently vanished on every launch). A single sharedtoSourceBreakpointin@debugmcp/sharednow feeds all four (SessionManager live re-send, worker initial breakpoints, connection-manager helper, js-debug handshake), andinitialBreakpointscarrieslogMessage/suspendPolicyend-to-end with message-parser validation.suspendPolicyis now honored for Java instead of silently dropped.Mock adapter
Simulates logpoints for hermetic e2e: advertises
supportsLogPoints, retainslogMessageon stored breakpoints, and its run simulation emitsoutputevents (naive{expr}interpolation) instead of stopping at logpoint lines — shared walk for both launch and continue paths.Tests
initialBreakpointssnapshot, message-parser accept/reject, connection-manager mapping, worker forwarding, js-debug handshake mapping, server gating (all four verdicts), and the launch-time capability drift annotation.tests/e2e/mcp-server-logpoints.test.ts, language-parameterized across all 8 adapters — python/javascript/go/rust/mock log without pausing (verified against the real adapters); java/dotnet fail fast; ruby warns. 8/8 pass locally. Python additionally asserts real interpolation (LP-MARK a=1).fibonacci.py's iteration line streamedLOGPOINT a=0 b=1→a=21 b=34intoget_outputwhile the program ran to completion, never pausing.Docs
tool-reference (logpoints section + adapter support matrix),
docs/javascript/README.md(the phantom example is now true), jit-diagnostics README (non-breaking inspection pattern), both skill copies + all per-language references, CHANGELOG.🤖 Generated with Claude Code