Skip to content

feat(executions): unified fleet executions dashboard (#18)#852

Open
oleksandr-korin wants to merge 7 commits into
devfrom
feature/18-unified-executions-dashboard
Open

feat(executions): unified fleet executions dashboard (#18)#852
oleksandr-korin wants to merge 7 commits into
devfrom
feature/18-unified-executions-dashboard

Conversation

@oleksandr-korin
Copy link
Copy Markdown
Contributor

@oleksandr-korin oleksandr-korin commented May 15, 2026

Summary

  • New GET /api/executions + GET /api/executions/stats endpoints — fleet-level execution history with access control (admin sees all, non-admin sees accessible agents only)
  • Stats via single-pass conditional aggregation; list supports filtering by status / trigger / hours / agent / search with offset pagination
  • Frontend /executions page: live stat cards (total, success rate, failed, cost), running strip, filter bar, load-more, per-row stop/navigate actions
  • Pinia store polls every 30s + refreshes on agent_activity WebSocket events
  • NavBar Executions link with yellow running-count badge

Test plan

  • Visit /executions as admin — all agents' runs visible
  • Visit /executions as non-admin — only accessible agents' runs visible
  • Filter by status, trigger, time range, agent, search — list and stat cards update
  • "N running now" strip appears when executions are running; disappears when they finish
  • Load More button appears when >50 results; appends correctly
  • NavBar badge shows correct live running count
  • WS reconnect replays missed events (no manual refresh needed after brief disconnect)
  • GET /api/executions/stats returns correct running_count independent of hours filter
  • Non-admin user with zero accessible agents gets empty list (not 500)

Closes #18

🤖 Generated with Claude Code

oleksandr-korin and others added 5 commits May 15, 2026 12:03
New /api/executions + /api/executions/stats endpoints expose fleet-level
execution history with per-agent access control (admin = all, non-admin =
accessible agents). Stats use single-pass conditional aggregation; list
supports filtering by status/trigger/hours/agent/search with offset
pagination. Router mounts /stats before "" to prevent route shadowing.

Frontend adds /executions page with live stat cards, filter bar, running
strip, load-more pagination, and per-row stop/navigate actions. Pinia
store polls every 30s and refreshes on agent_activity WS events. NavBar
gains an Executions link with a yellow running-count badge.

Closes #18

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Wire live/polling status dot to real WebSocket isConnected ref; remove
  dead wsStatus state that was always 'connected'
- Guard WS event handler: skip refresh when a fetch is already in flight
  to prevent concurrent redundant requests on rapid schedule_start/end bursts
- Add missing 'error' option to status filter dropdown (was in backend
  _VALID_STATUSES and statusBadgeClass but not filterable from UI)
- Add missing 'fan_out' option to trigger filter dropdown (same gap)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- requirements.md: add §10.10 Unified Executions Dashboard (EXEC-022)
- architecture.md: add Executions endpoint table under API Endpoints
- feature-flows.md: add index entry for executions-dashboard.md
- feature-flows/executions-dashboard.md: new vertical slice doc (UI → API → DB)
- tests/unit/test_fleet_executions.py: 28 unit tests covering _narrow_to_agent,
  get_fleet_executions SQL (access control, filters, pagination, error_summary),
  and get_fleet_execution_stats SQL (windowed vs all-time, running_count always-live,
  zero-division guard) — all passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- appearance-none + custom SVG chevron on all 4 filter selects
- active filter state: 2px primary-blue border + font-medium when non-default value set
- row hover: left accent bar + bg tint + chevron nudge

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleksandr-korin oleksandr-korin requested a review from vybe May 15, 2026 14:20
Replaced manual sys.modules injection (spec_from_file_location) with a
one-line local copy of iso_cutoff. No logic change — eliminates the 3
sys.modules violations caught by the CI pollution checker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@vybe vybe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation overall — docs complete, SQL safe, access control correct. Not merging this release, but want it ready for next week. Two things to address before then:

  • NavBar badge shows 0 from all non-executions pages. useExecutionsStore() is instantiated in NavBar but stats is never populated until the user actually visits /executions. The running-count badge is a stated feature — add a store.fetchStats() call in NavBar's onMounted so it populates on initial load from any page. One lightweight stats call is enough; no polling needed from NavBar.

  • Complete the open test plan items. Three manual scenarios are still unchecked. The unit tests cover the logic, but please confirm them manually and mark them done (or explicitly note they're covered by the unit tests and close them).

Will check again next week.

1. NavBar badge populates from any page — added executionsStore.fetchStats()
   call in NavBar's onMounted. Previously the running-count badge stayed at 0
   until the user actually visited /executions because stats were only
   fetched when the page mounted.

2. Test plan items resolved — marked each scenario as either manually verified
   (during the 2026-05-15 dev review with 83 seeded executions) or as covered
   by the unit tests in tests/unit/test_fleet_executions.py. One item
   (WS-driven strip disappearance) noted as code-reviewed but not run
   end-to-end against a live schedule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@oleksandr-korin
Copy link
Copy Markdown
Contributor Author

Both review items addressed in 8ddc45c:

  1. NavBar badge fixexecutionsStore.fetchStats() now fires in NavBar's onMounted, so the running-count badge populates on initial load from any page (not just /executions). One lightweight stats call on mount; no polling added at the NavBar layer.

  2. Test plan items — went through all 7 scenarios + edge cases. Marked each as either manually verified during the 2026-05-15 dev review (with 83 seeded executions) or as covered by the unit tests. One sub-item flagged honestly: the strip-disappears-on-WS-completion check requires a real schedule run to validate end-to-end; the WS handler logic was confirmed via code review only.

Ready for your next-week check.

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.

2 participants