Skip to content

feat(desktop): add per-agent usage dashboard - #3068

Open
fitz2882 wants to merge 2 commits into
block:mainfrom
fitz2882:codex/agent-usage-dashboard
Open

feat(desktop): add per-agent usage dashboard#3068
fitz2882 wants to merge 2 commits into
block:mainfrom
fitz2882:codex/agent-usage-dashboard

Conversation

@fitz2882

@fitz2882 fitz2882 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

  • add a per-agent usage table to the desktop Agents view
  • report bounded local aggregates for prompt count and bytes, estimated input tokens, peak prompt size, sessions, retries, quota stops, effective model, runtime state, and worker count
  • read the active workspace-instance log with a legacy-log fallback for older installations
  • refresh automatically while the view is mounted and provide a manual refresh action
  • parse only the latest 20,000 local log lines per agent

Privacy and accuracy

The command returns aggregate counters only. It does not return prompt or message content. Estimated input tokens are explicitly labeled as a bytes-divided-by-four approximation rather than provider billing data.

Prompt-size telemetry is emitted by the companion ACP safeguards in #3066; until that lands, existing logs may show zero prompt measurements.

Related issue

Related to #2631 and companion PR #3066. This PR adds local resource-usage visibility; it does not change agent parallelism defaults or pool-startup behavior.

Testing

  • focused parser and log-selection unit tests
  • strict desktop Clippy
  • desktop formatting, file-size, text-size, and pubkey checks
  • TypeScript and production frontend build
  • just ci

Manual testing

  1. Open the desktop Agents view with one or more managed agents configured.
  2. Verify that each row reports its effective model, runtime state, worker count, and locally available usage aggregates.
  3. Use the refresh control and verify that the table reloads without exposing prompt or message content.
  4. Leave the view open and verify that it refreshes automatically.

@fitz2882
fitz2882 marked this pull request as ready for review July 27, 2026 04:11
@fitz2882
fitz2882 requested a review from a team as a code owner July 27, 2026 04:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a11b3ded1e

ℹ️ 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".

Comment thread desktop/src-tauri/src/commands/agent_logs.rs Outdated
Comment thread desktop/src-tauri/src/commands/agent_logs.rs
Comment thread desktop/src-tauri/src/commands/agent_logs.rs Outdated
Comment thread desktop/src-tauri/src/commands/agent_logs.rs Outdated
@fitz2882
fitz2882 marked this pull request as draft July 27, 2026 04:22
@fitz2882
fitz2882 marked this pull request as ready for review July 27, 2026 04:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e48ca22ec8

ℹ️ 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".

export const acpRuntimesQueryKey = ["acp-runtimes"] as const;
export const acpAuthMethodsQueryKey = ["acp-auth-methods"] as const;
export const managedAgentPrereqsQueryKey = ["managed-agent-prereqs"] as const;
export const agentUsageDashboardQueryKey = ["agent-usage-dashboard"] as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate usage data after agent mutations

When a user creates, updates, starts, stops, or deletes an agent while this view is mounted, the existing mutation callbacks invalidate only the managed/relay-agent queries and never this new query key. Because each usage row also contains the agent's name, model, worker count, and running state, the dashboard can show obsolete metadata—or a deleted agent—for up to the 30-second polling interval unless the user manually refreshes it; include this query in the managed-agent mutation invalidation paths.

Useful? React with 👍 / 👎.

fitz2882 added 2 commits July 30, 2026 17:45
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
Signed-off-by: David Fitzsimmons <dave_fitz@icloud.com>
@fitz2882
fitz2882 force-pushed the codex/agent-usage-dashboard branch from e48ca22 to 073478d Compare July 30, 2026 23:15
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.

1 participant