Conversation
Adds the agent-usage UI feature on top of the merged NIP-AM backend. - `desktop/src/features/agent-usage/`: daily bars chart, 7/30-day range tabs, focused agent view with caveats, hooks, and lib utilities. All state is driven by the `get_agent_usage_series` Tauri command. - Profile panel: usage ingress row + focused view wired into agent profiles; gated on owner-scoped visibility (`viewerIsOwner && isBot`). - `AgentsView`: agent-usage overview section. - `AgentsScreen`/`ProfilePanelContext`: usage navigation state. - `e2eBridge.ts` + `tests/helpers/bridge.ts`: `get_agent_usage_series` mock handler + fixture types, including the M2 cache fields (`cacheReadTokens`, `cacheWriteTokens`, `freshInputTokens`) the wire type carries. The UI absorbs but does not display these fields. - `tests/e2e/agent-usage.spec.ts` + `agent-usage-screenshots.spec.ts`: Playwright coverage for loading, empty state, bars, range switching, error/retry, focused view, caveats, and cache invalidation. - `desktop/playwright.config.ts`: agent-usage specs added to suite. - `desktop/package.json`: recharts dependency. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com> (cherry picked from commit 3d723a7) Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
…t-usage focused view The plumbing already returned cacheReadTokens/cacheWriteTokens/freshInputTokens at every scope of AgentUsageSeries, but the focused view rendered only the four top-level stats and never surfaced them. Add an Input-breakdown subsection to the totals card (Cache read / Cache write / Fresh input) gated on any known cache value, and a compact per-model breakdown line. Fields follow the existing unknown-not-zero semantics: absent subsets are omitted, a known-but-incomplete value shows its lower bound with a Partial marker, and a scope with no cache data renders no subsection at all. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com> (cherry picked from commit b01a381) Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abf93e3b94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| React.useEffect(() => { | ||
| if (canViewUsage || !query.data) return; | ||
| if (query.data.hasArchivedEvidence !== true) onIneligible(); |
There was a problem hiding this comment.
Wait for ownership resolution before redirecting usage views
When an owned agent's Usage view is opened directly, the local SQLite usage query can resolve before the asynchronous profile/relay-agent queries establish ownership. During that window canViewUsage is false; if the agent has no archived evidence, this effect redirects to the summary and never restores the requested view after ownership resolves. Treat unresolved ownership separately from confirmed ineligibility before calling onIneligible.
Useful? React with 👍 / 👎.
|
Packaging evidence: the restacked dashboard was combined with #6692 and successfully bundled into Buzz Linza Patched 0.5.18 after 21/21 focused Playwright E2E tests, 36 focused unit tests, typecheck, Biome, and build:e2e. The installed bundle passes strict deep codesign verification; the prior 0.5.17 app remains as a rollback backup. |
Supersedes #4001 with the same dashboard restacked onto current
main.Summary
Validation on current main
pnpm typecheckpnpm build:e2egit diff --check origin/main...HEADThe branch was rebased onto current
mainat0720f5380ce8a6c050afac159f8462c06cd51ab5; the only rebase conflict was additive E2E bridge command registration, resolved by retaining both current archive/unread commands andget_agent_usage_series.