Skip to content

Conversation

@ogabrielluiz
Copy link
Contributor

Summary

Adds breakpoint and checkpoint functionality to the Graph class, enabling pause/resume execution at specific vertices.

Breakpoints: Pause graph execution before a specific vertex runs

  • graph.add_breakpoint(vertex_id) - Set a pause point
  • graph.resume() - Continue after pause
  • graph.is_paused - Check if paused
  • graph.get_breakpoint_checkpoint() - Get state at pause point

Checkpoints: Save/restore graph execution state

  • graph._get_graph_snapshot() - Capture current state (JSON-serializable)
  • graph.restore_from_snapshot(snapshot) - Restore from saved state

Changes

  • Add breakpoint system to Graph class (add/remove/clear/resume)
  • Add checkpoint save/restore functionality
  • Fix JSON serialization in RunnableVerticesManager (sets to lists)
  • Add validation for snapshot restoration
  • Add exception cleanup for breakpoint state
  • Add tests for breakpoints and checkpoints

Update tests to expect empty defaults instead of KeyError when
optional keys are missing from dict during deserialization.
Add 13 tests covering:
- Snapshot captures state (run_manager, queue, context, etc.)
- Restore from snapshot works correctly
- JSON serialization roundtrip
- Complex nested data preservation
- Validation for missing keys and invalid vertex IDs
Add 15 tests covering:
- Add/remove/clear breakpoints
- Invalid vertex validation
- Pause at first/middle/last vertex
- Multiple breakpoints and sequential resumes
- Resume after pause
- Exception cleanup
- Empty queue handling
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 18, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/graph-breakpoints

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added community Pull Request from an external contributor enhancement New feature or request labels Dec 18, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 18, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 18, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Pull Request from an external contributor enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants