Repository navigation
feat(reborn): add automation pause resume - #5131
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. 📝 WalkthroughWalkthroughAdds caller-scoped pause/resume lifecycle to scheduled triggers. New ChangesAutomation Pause/Resume Lifecycle
Sequence Diagram(s)sequenceDiagram
participant Browser as Browser (AutomationsPage)
participant useAutomations as useAutomations hook
participant ApiClient as api.js
participant WebUIHandler as webui_v2 handler
participant RebornServices as RebornServices facade
participant CompositionFacade as RebornAutomationProductFacade
participant TriggerRepo as TriggerRepository
Browser->>useAutomations: user clicks pause button
useAutomations->>ApiClient: pauseAutomation({ automationId })
ApiClient->>WebUIHandler: POST /api/webchat/v2/automations/{id}/pause
WebUIHandler->>RebornServices: pause_automation(caller, automation_id)
RebornServices->>RebornServices: require agent_bound_caller or 400
RebornServices->>CompositionFacade: pause_automation(agent_caller, automation_id)
CompositionFacade->>CompositionFacade: parse_trigger_id or 400
CompositionFacade->>TriggerRepo: set_scoped_trigger_state(tenant,user,agent,project,id,Paused)
TriggerRepo-->>CompositionFacade: Ok(Some(record)) or Ok(None)
CompositionFacade-->>RebornServices: RebornAutomationMutationResponse
RebornServices-->>WebUIHandler: RebornAutomationMutationResponse
WebUIHandler-->>ApiClient: 200 JSON
ApiClient-->>useAutomations: response
useAutomations->>useAutomations: invalidateAutomations() + refetch
useAutomations-->>Browser: updated state
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements the ability to pause and resume scheduled automations (triggers) across the backend repositories, API endpoints, and WebUI v2 frontend. It introduces the builtin.trigger_pause and builtin.trigger_resume capabilities, updates the SQL and in-memory repositories to safely transition trigger states, and adds pause/resume controls to the WebUI automation detail panel. Additionally, an auto-refresh mechanism is introduced to dynamically adjust polling intervals. Feedback on the changes highlights a critical issue in the auto-refresh hook (useAutomations.js), where a null refresh delay would halt periodic polling entirely; the reviewer suggests falling back to a base refetch interval of 30 seconds to ensure the UI continues to poll.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
@claude review |
|
BLOCK: Reviewed current head I did not find a new blocking code issue in the pause/resume implementation after checking the trigger repository contract, libSQL/Postgres scoped state updates, host-runtime first-party capabilities, product facade/service forwarding, WebUI v2 route descriptors/handlers, and the frontend action wiring. The scoped mutation path preserves tenant/user/agent/project boundaries, refuses to mutate completed triggers, and has caller-level coverage through repository, product-service, and HTTP route tests. I am not calling this ready for human final review because CI is not green on this head. Current status includes pending I also checked Gemini's Human review focus once CI settles: verify the product decision that resume preserves the existing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/ironclaw_triggers/src/lib.rs`:
- Around line 1275-1298: The set_scoped_trigger_state method allows
transitioning a trigger to Paused state while an active fire is running, which
can be silently undone by clear_active_fire forcing the state back to Scheduled
if another slot exists, causing the user's pause intent to be lost. Add
validation in set_scoped_trigger_state to check if the record has an active fire
and prevent transitioning to TriggerState::Paused in that case, returning an
error to indicate the trigger cannot be paused while a fire is in-flight.
Additionally, add a caller-level regression test that verifies the invariant:
pause a trigger while an active fire is running, then call clear_active_fire,
and confirm the trigger remains in Paused state instead of reverting to
Scheduled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 92b1a061-7e9f-4545-a2c4-c9066d8e06b4
⛔ Files ignored due to path filters (1)
crates/ironclaw_webui_v2_static/static/dist/app.jsis excluded by!**/dist/**
📒 Files selected for processing (39)
FEATURE_PARITY.mdcrates/ironclaw_host_runtime/src/first_party_tools/mod.rscrates/ironclaw_host_runtime/src/first_party_tools/schemas.rscrates/ironclaw_host_runtime/src/first_party_tools/trigger_management.rscrates/ironclaw_host_runtime/src/lib.rscrates/ironclaw_host_runtime/tests/first_party_builtin_tools.rscrates/ironclaw_product_workflow/src/lib.rscrates/ironclaw_product_workflow/src/reborn_services.rscrates/ironclaw_product_workflow/src/reborn_services/types.rscrates/ironclaw_product_workflow/tests/reborn_services_contract.rscrates/ironclaw_reborn_composition/src/automation.rscrates/ironclaw_reborn_composition/src/automation/tests.rscrates/ironclaw_reborn_composition/src/automation/tests/mutation_tests.rscrates/ironclaw_reborn_composition/src/automation/tests/resolver_tests.rscrates/ironclaw_reborn_composition/src/local_dev_capability_policy.rscrates/ironclaw_reborn_composition/src/local_dev_capability_policy.tomlcrates/ironclaw_triggers/src/lib.rscrates/ironclaw_triggers/src/libsql.rscrates/ironclaw_triggers/src/postgres.rscrates/ironclaw_triggers/src/worker/tests.rscrates/ironclaw_triggers/tests/repository_contract.rscrates/ironclaw_webui_v2/src/descriptors.rscrates/ironclaw_webui_v2/src/handlers.rscrates/ironclaw_webui_v2/src/lib.rscrates/ironclaw_webui_v2/src/router.rscrates/ironclaw_webui_v2/tests/webui_v2_descriptors_contract.rscrates/ironclaw_webui_v2/tests/webui_v2_handlers_contract.rscrates/ironclaw_webui_v2_static/src/assets.rscrates/ironclaw_webui_v2_static/static/js/design-system/icons.jscrates/ironclaw_webui_v2_static/static/js/lib/api.jscrates/ironclaw_webui_v2_static/static/js/lib/api.test.mjscrates/ironclaw_webui_v2_static/static/js/pages/automations/automations-page.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/components/automation-detail-panel.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/components/automations-list.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/hooks/useAutomations.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-presenters.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-presenters.test.mjscrates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-refresh.jscrates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-refresh.test.mjs
think-in-universe
left a comment
There was a problem hiding this comment.
CI root cause from Reborn root tests (0) is actionable on this head.
|
🚅 Deployed to the ironclaw-pr-5131 environment in ironclaw-ci-preview
|
|
@claude review |
|
BLOCK: Reviewed current head I reviewed the follow-up diff from The previous Reborn first-party E2E coverage blocker also appears addressed in code: I am still not calling this ready for human final review because CI is not green yet on the new head. GitHub currently shows the fresh checks in progress/pending, including Reborn root tests, all-features tests/clippy, smoke jobs, CodeRabbit, and Railway preview. Human review focus after CI settles: confirm the intended semantics that pausing during an active run should let the active run finish but prevent the next scheduled fire until explicit resume, and that the trace coverage is sufficient despite pause/resume returning |
This comment was marked as resolved.
This comment was marked as resolved.
|
WATCH: Reviewed current head This new commit is a narrow follow-up that changes I did not find a new code issue in this one-line delta. I am not requesting another Claude review because this is a small targeted CI fix, not a significant new behavior or storage/security change. I am not calling the PR ready yet because the new CI run is still in progress and CodeRabbit/Railway are pending on this head. No approval or merge from me. |
|
PASS: Human final-review guidance for reviewed head CI is now green on this head with no pending or failing checks reported. GitHub still shows Human review focus:
No approval or merge from me. |
…t-work # Conflicts: # crates/ironclaw_webui_v2/src/lib.rs # crates/ironclaw_webui_v2/tests/webui_v2_descriptors_contract.rs
Summary
builtin.trigger_pauseandbuiltin.trigger_resumeare available to first-party tool dispatch.next_run_atboundary and while runs are active.Testing
cargo test -p ironclaw_triggers --features libsqlcargo test -p ironclaw_host_runtime --test first_party_builtin_tools builtin_trigger --features test-supportcargo test -p ironclaw_product_workflow --test reborn_services_contract automationcargo test -p ironclaw_reborn_composition automation --features test-supportcargo test -p ironclaw_reborn_composition bundled_local_dev_capability_policy_parses --features test-supportcargo test -p ironclaw_webui_v2 --features webui-v2-betacargo test -p ironclaw_webui_v2_static automations_panel_assets_are_embedded --features webui-v2-betanode --test crates/ironclaw_webui_v2_static/static/js/lib/api.test.mjsnode --test crates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-refresh.test.mjsTZ=UTC node --test crates/ironclaw_webui_v2_static/static/js/pages/automations/lib/automations-presenters.test.mjsNotes
next_run_at, so an overdue paused automation may fire shortly after resume.