Skip to content

feat(automations): scheduled cycles, grouped runs, and run details UI#438

Open
Kazet111 wants to merge 14 commits intoSoju06:mainfrom
Kazet111:feature/automations-cycle-scheduling-and-run-details
Open

feat(automations): scheduled cycles, grouped runs, and run details UI#438
Kazet111 wants to merge 14 commits intoSoju06:mainfrom
Kazet111:feature/automations-cycle-scheduling-and-run-details

Conversation

@Kazet111
Copy link
Copy Markdown
Contributor

@Kazet111 Kazet111 commented Apr 19, 2026

Summary

  • add a new end-to-end Automations subsystem across backend, database, OpenSpec, and frontend
  • add scheduled and manual automation execution with grouped run-cycle tracking
  • add cycle snapshot persistence so one automation cycle keeps a stable account set and dispatch plan
  • add Jobs and Recent runs views with backend-driven search, filters, and pagination
  • add Run details diagnostics with per-account execution state and grouped cycle summaries
  • surface automation-generated traffic in Request Logs

Dependency / merge order

This PR includes overlapping changes relative to #415 and should be merged after it.

Related issue

Problem

The project did not yet have a dedicated automations subsystem.

That meant there was no built-in way to:

  • define recurring automation jobs
  • execute one automation cycle across multiple accounts
  • track grouped run state for a cycle
  • inspect per-account outcomes within one run
  • manage automation jobs and runs from a dedicated UI
  • correlate automation traffic with Request Logs

Changes

New backend automations module

  • add a dedicated automations API with endpoints for:
    • jobs listing
    • job filter options
    • runs listing
    • run filter options
    • run details
    • create job
    • update job
    • delete job
    • run now (202 Accepted)
  • add automations service / repository / scheduler implementation
  • add timezone-aware daily scheduling
  • add threshold-based dispatch spreading across accounts
  • add grouped cycle execution semantics for scheduled and manual runs
  • add cycle status resolution for:
    • running
    • partial
    • success
    • failed

Database and run-cycle snapshot model

  • add automations schema and base migrations
  • add grouped run-cycle snapshot tables:
    • automation_run_cycles
    • automation_run_cycle_accounts
  • freeze cycle membership at cycle creation time so later account-state changes do not mutate an already started cycle
  • freeze per-account dispatch timestamps for the cycle so threshold edits do not rewrite an in-flight dispatch plan
  • backfill legacy manual-cycle history into grouped cycle snapshots
  • add model and query support for grouped cycle listing, stable run details, and per-cycle diagnostics

New Automations UI

  • add Automations page and route integration
  • add Jobs view with backend-driven:
    • search
    • filters
    • pagination
    • rows per page
    • reset
  • add Recent runs view with backend-driven:
    • search
    • filters
    • pagination
    • rows per page
    • reset
  • add Add automation dialog with:
    • structured form layout
    • validation
    • timezone selection
    • threshold configuration
    • reasoning effort selection
  • add Run details modal with:
    • grouped cycle summary metrics
    • per-account execution table
    • mixed-result visibility
    • scalable rendering for larger runs
    • stable grouped diagnostics for scheduled and manual cycles

Request Logs visibility

  • wire automation-triggered executions into Request Logs visibility
  • make it possible to correlate automation runs with actual downstream requests

OpenSpec

  • add and complete the OpenSpec change under openspec/changes/add-automations-scheduled-pings/:
    • proposal
    • design
    • tasks
    • automations delta spec
    • frontend-architecture delta spec
    • context

Screenshots

image image image image

Testing

Added or updated coverage for:

  • backend automations integration flows
  • backend automations service logic
  • schedule computation and grouped cycle behavior
  • cycle snapshot persistence and legacy backfill behavior
  • run listing and run-details responses
  • frontend automations integration flow
  • frontend hooks, schemas, and time/account display utilities

Validation

  • openspec validate --specs
  • uvx ruff check .
  • uvx ruff format --check .
  • uv run ty check
  • uv run pytest
  • cd frontend && bun run lint
  • cd frontend && bun run typecheck
  • cd frontend && bun run test:coverage
  • migration smoke test:
    • upgrade -> downgrade -> upgrade

Latest local backend result:

  • 1824 passed, 7 skipped, 4 warnings

Frontend coverage result:

  • global coverage passes configured thresholds
  • src/features/automations coverage:
    • 91.89% statements
    • 79.51% branches
    • 91.78% lines

Result

This PR introduces a new Automations subsystem with scheduling, grouped run cycles, stable cycle snapshots, per-account execution diagnostics, and dedicated UI management flows,
while partially delivering the functionality described in #433.

@Kazet111 Kazet111 marked this pull request as draft April 19, 2026 10:32
@Kazet111 Kazet111 marked this pull request as ready for review April 19, 2026 12:26
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.

1 participant