Skip to content

feat(debug): call graph, state events, and breakpoint improvements#1319

Merged
cristipufu merged 1 commit intomainfrom
feat/debug-runtime-improvements
Feb 15, 2026
Merged

feat(debug): call graph, state events, and breakpoint improvements#1319
cristipufu merged 1 commit intomainfrom
feat/debug-runtime-improvements

Conversation

@cristipufu
Copy link
Member

@cristipufu cristipufu commented Feb 15, 2026

Summary

  • AST-based call graph builder (graph_builder.py): parses user code from an entrypoint function, builds a UiPathRuntimeGraph with file:line node IDs that double as breakpoint locations
  • State events during execution: emits UiPathRuntimeStateEvent for every call-graph function entry (even without breakpoints), so the debug bridge can visualise execution flow through graph nodes
  • OTEL context propagation: copies contextvars to the background trace thread so @traced decorator spans are properly linked to the parent trace
  • Breakpoint reliability fixes:
    • Node IDs point to the first executable body line (skipping docstrings) instead of the def line, preventing false breakpoint hits during module imports
    • <module> frame line events are skipped in the trace callback
    • Per-frame deduplication prevents multiline expressions (e.g. return Foo(arg=bar(...))) from triggering the same breakpoint twice due to bytecode line bouncing
image

Test plan

  • 11 tests for AST call graph builder (multi-file, async, relative imports, depth limits, etc.)
  • E2E tests for state events: with/without breakpoints, through decorator wrappers, external function exclusion
  • Test for multiline expression breakpoint deduplication
  • All 1968 existing tests pass
  • ruff check, ruff format, mypy all clean

🤖 Generated with Claude Code

- Add AST-based call graph builder (graph_builder.py) that parses user
  code and builds a UiPathRuntimeGraph with file:line node IDs
- Include call graph in runtime schema returned by get_schema()
- Emit UiPathRuntimeStateEvent for call-graph functions during execution,
  even without breakpoints, so the debug bridge can visualise flow
- Propagate OTEL context to background trace thread via contextvars
- Use first body line (skipping docstrings) for node IDs so breakpoints
  don't fire during module imports
- Skip <module> frame line events to avoid breakpoints on def statements
- Deduplicate breakpoint hits per frame to prevent multiline expressions
  from triggering the same breakpoint twice

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Feb 15, 2026
@cristipufu cristipufu merged commit e3d7a29 into main Feb 15, 2026
50 checks passed
@cristipufu cristipufu deleted the feat/debug-runtime-improvements branch February 15, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant