feat(internal): merge Pi canary, bounded agents, and usage UI - #1
Conversation
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
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>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
|
@codex review |
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
|
Review audit complete for exact head
Additional validation: Node 20/20; desktop and Rust targeted tests PASS; live Caliper 0.2.0 broker smoke inbound |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 702812b404
ℹ️ 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".
| let reply_to = batch | ||
| .events | ||
| .last() | ||
| .or_else(|| batch.cancelled_events.last())? | ||
| .event | ||
| .id | ||
| .to_hex(); |
There was a problem hiding this comment.
Route brokered replies through the resolved thread anchor
When Pi handles a human reply inside an existing channel thread, this always sets replyTo to the newest event ID. However, format_prompt deliberately uses resolve_reply_anchor to target the thread root and keep human-facing replies flat at layer 1. Because buzz_reply treats this metadata as authoritative, Pi responses become nested under the triggering comment instead of following the routing shown in the prompt; derive this value with the same thread/DM anchor logic used by format_prompt.
Useful? React with 👍 / 👎.
| const result = await tool.execute( | ||
| String(event.id), | ||
| event.args ?? {}, | ||
| new AbortController().signal, | ||
| ); |
There was a problem hiding this comment.
Abort brokered tools when the ACP prompt is cancelled
If cancellation or the harness deadline occurs while buzz_reply is running, this creates an untracked controller whose signal is never aborted. session/cancel only aborts the Pi session, while the broker's separately spawned buzz messages send process continues and can publish after the turn has already completed as cancelled. Store a per-prompt controller and abort it from cancellation and teardown so cancelled work cannot produce a late channel message.
Useful? React with 👍 / 👎.
Signed-off-by: evgeniy.chernomortsev <j.malkovitc@gmail.com>
|
Follow-up exact head |
Internal downstream patch
Merges the production-proven Pi ACP canary, opt-in Codex efficiency controls, empty-message hardening, and NIP-AM agent-usage UI into the fork only. This is not intended for upstream
block/buzz.Review feedback resolved
BUZZ_PRIVATE_KEYand auth tag stay in the trusted adapter; Pi publications use a typed parent-side broker;0.2.0version gate;0/12product defaults preserved).Checks
git diff --check: PASSPi remains canary-only; no fleet-wide runtime switch.