feat: subagent and profile analytics across panel, server, and CLI#244
Merged
Conversation
GetReportRequest gains profile (CLI --profile) and profiles (panel multi-select) so analytics reports can be scoped per profile, and the report-name comment now enumerates the full report set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
buildWhere honors the new profile/profiles request fields, and GetReport gains five reports: usage_by_hour (hour-of-day model/token profile), subagent_usage_by_day (direct vs subagent usage split), subagent_parents (one row per spawning session), profile_usage (per device/agent/profile/ model with token sums and last activity), and profiles_by_day. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
prosa analytics subagents mirrors the server's per-parent-agent fan-out report against the local SQLite store, and the remote path now maps --profile onto the GetReport request instead of silently dropping it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Home and Insights filter drawers gain a profile multi-select wired through dashboardReportRequest onto the analytics RPC's repeated profiles field, with active-filter chips and dropdown options sourced from the profiles report (shared with the sessions page via profileLabelsFromRows). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/insights gains an Across the day card (sessions per local hour stacked by model plus tokens per hour, from usage_by_hour) and a full Delegation section: KPI strip with delegated token share and estimated subagent spend, a weekly delegated-share trend, a fan-out histogram, and a top-delegating-sessions list deep-linking into /sessions. The per-parent agent table keeps its card. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/profiles grows from a bare table into a dashboard sharing the Home/ Insights filter chrome: KPI strip (active profiles, sessions outside default, tokens, est. spend), a stacked sessions-per-profile weekly trend, tokens & cost per agent·profile with a cost donut, and the device × agent × profile table enriched with tokens, cost, and last seen — cells still deep-link into /sessions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ts CLI report screens.md gains the Delegation and Across-the-day cards on Insights, the Profiles dashboard section, and the profile filter in the shared drawer; panel.md and server.md reflect the new routes and reports; cli.md and usage.md list prosa analytics subagents. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…dings Lowercase the profiles empty-state message per the design contract, document the sessions page's five filter controls (profile included), and list all seven pages in the command palette mock. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Richer visibility into subagent delegation and per-agent profiles, built entirely on existing columns (
sessions.parent_session_id,sessions.profile,session_usage) — no schema changes, no new dependencies.Server — five new reports + profile filtering
GetReportRequestgainsprofile/profilesfields;buildWherescopes every report by them.usage_by_hour(hour-of-day model/token profile),subagent_usage_by_day(direct vs subagent usage split),subagent_parents(one row per spawning session),profile_usage(per device/agent/profile/model with token sums + last activity),profiles_by_day.Panel
/sessions. The per-parent-agent table keeps its card.default, tokens, est. spend), stacked weekly sessions-per-profile trend, tokens & cost peragent·profilewith a cost donut, and the device × agent × profile table enriched with tokens, cost, and last seen.CLI
prosa analytics subagents— SQLite mirror of the per-parent-agent fan-out report.--profilenow applies with--remote(was silently dropped).Docs
docs/panel/screens.md(Insights cards, new Profiles section, 7-entry sidebar),docs/architecture/{panel,server,cli}.md,docs/usage.md, and the proto report enumeration are aligned with the new surface.Known caveat (documented in screens.md)
The delegated-token share counts any session with a parent edge, while the parent-grouped KPIs require the parent row to exist — a child whose parent was never imported counts in the share but not under spawning sessions.
Test plan
go test -race ./...including Postgres-backed e2e (PROSA_TEST_PG_URL) covering all five new reports and both profile-filter pathsgolangci-lint,go vet,gen-check,lint-mdcleanprosa analytics subagents(table +--json)🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.