Skip to content

Conversation

@neelasha-writer
Copy link
Collaborator

@neelasha-writer neelasha-writer commented Jan 30, 2026

Summary by CodeRabbit

  • New Features

    • Start/stop blueprint execution from the builder UI and from individual components; dropdown includes a Run option with dynamic label and status.
    • Added server-side entry points to run single branches and batch branch executions.
  • Refactor

    • Improved blueprint run state tracking for more accurate real-time status in the UI.
  • Tests

    • Updated dropdown tests to account for the new Run option.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

Adds a "Run" action to component builder settings and exposes component-level blueprint run/stop controls, ties UI handlers to the blueprint runtime hook, and adds backend methods to execute single and batch branch runs.

Changes

Cohort / File(s) Summary
Builder settings & component actions
src/ui/src/builder/settings/useBuilderSettingsActions.ts, src/ui/src/builder/useComponentActions.ts
Added Run dropdown action, wired async handlers (run/stop) through builder settings to component actions; exported runBlueprintFromComponent, stopBlueprintFromComponent, isBlueprintRunning, and isRunAllowed.
Blueprint runtime hook
src/ui/src/composables/useBlueprintRun.ts
Reworked isRunning to derive from wfbm.activeBlueprintRunId; changed useBlueprintsRun to accept MaybeRef<BlueprintsRunListItem[]> and removed local running flag.
Backend blueprint runner
src/writer/blueprints.py
Added run_branch and run_branch_batch methods on BlueprintRunner for single-branch and batched branch execution.
UI tests & layout
src/ui/src/builder/settings/useBuilderSettingsActions.spec.ts, src/ui/src/components/blueprints/base/BlueprintToolbar.vue
Updated tests to expect extra dropdown option; trivial whitespace formatting change in toolbar.

Sequence Diagram

sequenceDiagram
    participant User
    participant DropdownUI as Dropdown Menu
    participant BuilderActions as Builder Settings Actions
    participant ComponentActions as Component Actions
    participant BlueprintRuntime as Blueprint Runtime (useBlueprintRun)
    participant Backend as Backend (BlueprintRunner)

    User->>DropdownUI: Click "Run"
    DropdownUI->>BuilderActions: handleRunBlueprint(componentId)
    BuilderActions->>ComponentActions: runBlueprintFromComponent(componentId)
    ComponentActions->>BlueprintRuntime: run(componentId)
    BlueprintRuntime->>Backend: execute run_branch / run_branch_batch
    Backend-->>BlueprintRuntime: execution result
    BlueprintRuntime->>BuilderActions: update isBlueprintRunning / activeBlueprintRunId
    BuilderActions-->>DropdownUI: update label/icon

    User->>DropdownUI: Click "Stop"
    DropdownUI->>BuilderActions: handleStopBlueprint(componentId)
    BuilderActions->>ComponentActions: stopBlueprintFromComponent(componentId)
    ComponentActions->>BlueprintRuntime: stop(componentId)
    BlueprintRuntime-->>BuilderActions: activeBlueprintRunId cleared
    BuilderActions-->>DropdownUI: update label/icon
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested reviewers

  • madeindjs
  • as-flow
  • rodionchernyshov

Poem

🐰 A rabbit hops through code so bright,
Clicks "Run" and watches branches light,
Start, stop, and batch — a hoppity cheer,
State and actions now appear,
Blueprint blooms, the run is near!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Feat: Run from block AB 940' clearly references the issue number and describes the main feature added - running a blueprint from a specific block.
Linked Issues check ✅ Passed The PR implements all key coding objectives from AB-940: adds Run option in UI dropdown/settings, reuses blueprint execution logic via runBlueprintFromComponent, and integrates the stream event handling infrastructure.
Out of Scope Changes check ✅ Passed All changes are within scope - UI additions for Run action, backend methods for branch execution, composable updates for state management, and test updates to reflect new dropdown option.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-run-from-block-AB-940

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants