feat(ui): per-schedule performance scorecards on Agent Detail (Overview + Schedules tab) (#1115)#1149
Open
dolho wants to merge 1 commit into
Open
feat(ui): per-schedule performance scorecards on Agent Detail (Overview + Schedules tab) (#1115)#1149dolho wants to merge 1 commit into
dolho wants to merge 1 commit into
Conversation
Surface per-schedule performance on the Overview tab and the Schedules tab, both from a SINGLE compact aggregate (no N per-schedule round-trips) — extends #1107 (Overview) and generalises #868 (per-schedule deep analytics). Backend: - db `get_agent_schedules_summary(agent, hours)` — one rollup row per non-deleted schedule (zero-run schedules included): terminal success_rate (success / (success + failed[incl. error]); None when zero terminal), NULL-skipping avg_duration_ms, cost_total, context_avg, tool_call_total (parsed over newest 5,000 rows agent-wide, tool_calls_sampled flag), and last-run outcome. Cheap grouped SQL; iso_cutoff window (Invariant #16). - GET /api/agents/{name}/schedules/analytics-summary?window=7d|14d|30d (AuthorizedAgent). Declared BEFORE /{schedule_id} in routers/schedules.py so the literal segment isn't captured as a schedule_id (Invariant #4) — putting it in analytics.py would be shadowed (schedules_router mounts first). - models: ScheduleSummaryRow + AgentSchedulesSummaryResponse (Invariant #14). Frontend (single fetch, two consumers — Invariant #7): - executions.js fetchSchedulesSummary, cached per ${name}:${window} like fetchAgentAnalytics. - OverviewPanel: "Schedules performance" section, honors the existing 7/14/30d window selector, each row deep-links to the Schedules tab; hidden at zero. - SchedulesPanel: inline mini-stats per row (success rate, avg duration, runs, last-run dot) — badge style, no new chart/modal — from the same call. Tests: tests/unit/test_1115_schedules_summary.py (6) — terminal success rate, NULL-skip avg, tool-call total, zero-run-still-appears, soft-delete excluded, out-of-window excluded. Full analytics suites green (30 passed). Frontend prod build clean; endpoint verified live across 7/14/30d windows. Related to #1115 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Resolve by running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces per-schedule performance in two schedule-centric places, both from a single compact aggregate (no N per-schedule round-trips):
Extends #1107 (Overview) and generalises #868 (per-schedule deep analytics, which stays the drill-in target).
Backend
get_agent_schedules_summary(agent, hours)(db/schedules.py): one rollup per non-deleted schedule (zero-run schedules included with zeros). Per schedule — terminalsuccess_rate(success / (success + failed[incl. error]);None→—when zero terminal), NULL-skippingavg_duration_ms,cost_total,context_avg,tool_call_total(parsed over the newest 5,000 rows agent-wide,tool_calls_sampledflag), last-run outcome. Cheap grouped SQL;iso_cutoffwindow (Invariant #16).GET /api/agents/{name}/schedules/analytics-summary?window=7d|14d|30d(AuthorizedAgent). Declared before/{schedule_id}inrouters/schedules.pyso the literalanalytics-summaryisn't captured as a schedule_id — putting it inanalytics.pywould be shadowed sinceschedules_routermounts first (Invariant fix: add missing logging_config.py to backend Dockerfile #4).ScheduleSummaryRow+AgentSchedulesSummaryResponse(Invariant Add internal health route, without which main didn't start #14).Frontend (one fetch, two consumers — Invariant #7)
executions.jsfetchSchedulesSummary, cached per${name}:${window}likefetchAgentAnalytics.Verification
tests/unit/test_1115_schedules_summary.py— 6 tests: terminal success rate (incl.error; non-terminal excluded), NULL-skip avg duration, tool-call total (malformed JSON skipped), zero-run-still-appears (rate=None), soft-delete excluded, out-of-window excluded./{id}route not shadowed (404 on unknown id).AC
—on zero), token/cost, avg duration, total tool callsRelated to #1115
🤖 Generated with Claude Code