fix: resolve debug runtime breakpoint and state event inconsistencies#1404
Open
cristipufu wants to merge 4 commits intomainfrom
Open
fix: resolve debug runtime breakpoint and state event inconsistencies#1404cristipufu wants to merge 4 commits intomainfrom
cristipufu wants to merge 4 commits intomainfrom
Conversation
Fix four issues in the debug breakpoint stack: 1. project_dir mismatch: get_schema now uses CWD as project_dir (matching BreakpointController) so graph node IDs are consistent. 2. qualified_node_name line mismatch: state events now use graph node IDs (first-code-line) instead of frame.f_lineno (def line), so clients can map state events to graph nodes. 3. SignalR bridge node reference: _add_breakpoints and _handle_remove_breakpoints now prefer node.id (file:line format) over node.name for function runtimes. 4. Generator/coroutine spurious events: suppress duplicate STARTED on yield/await resumption and skip COMPLETED on yield. Also fix non-project coroutine frame state leak that could poison frame-id reuse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…bridge Revert bridge changes — handle function-name breakpoints entirely in BreakpointController._build_breakpoint_map by resolving bare names via the node_id_map. Replace SignalR bridge tests with controller-level resolution tests + an E2E test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Re-add the dedup guard for single-line expressions like `result = dict(value=bar(val))` where bytecode revisits the call-site line after evaluating nested arguments. Track last_line per frame and suppress only when the immediately preceding line event was the same line (no intervening lines), so loop iterations still fire correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the single-line-only last_line check with a smarter heuristic: track whether any backward jump (line < last_bp_line) occurred since the last breakpoint fired. Bounce-backs only advance forward into argument lines then return — no backward jump. Loop iterations go backward to the loop header first, so the breakpoint correctly fires again. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
get_schemanow uses CWD asproject_dir(matchingBreakpointController) so graph node IDs are consistent across schema and debug paths_first_code_line) instead offrame.f_lineno(defline), so clients can correctly map state events to graph nodes_add_breakpointsand_handle_remove_breakpointsnow prefernode.id(file:line format) overnode.name, enabling function-level breakpoints from the remote debuggerTest plan
TestProjectDirConsistency(2 tests): cross-file breakpoints via graph node IDs; schema and debug produce matching node IDsTestQualifiedNodeName(1 test): state eventqualified_node_namematches graph node IDs including for functions with docstringsTestGeneratorStateEvents(2 tests): generator yields and async await don't cause duplicate STARTED eventsTestSignalRBridgeBreakpoints(3 tests):node.idpreferred overnode.name; fallback to name; remove uses same logic🤖 Generated with Claude Code