You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitHub Copilot bills via a monthly premium-request quota rather than per-token, so its session files frequently record no per-message token usage. usage daily --agent copilot then shows all-zeros / $0.00 with no explanation, which reads as "spent nothing" (#349).
This adds a one-line stderr note from usage daily when the agent filter is an all-Copilot filter and the totals are zero. The agent filter accepts comma-separated lists, so IsCopilotAgentFilter treats an all-Copilot list (e.g. copilot,vscode-copilot) as Copilot. The note is an agent-property statement shown in response to an explicit --agent the user typed, so it needs no session-presence check.
Scope: this is the CLI half of #349. The dashboard hint is the harder half — to avoid showing it for an empty view it needs a timezone-correct, filter-faithful matching-session count from the sessions table (to distinguish "Copilot sessions with no usage" from "no matching sessions"), which is a cross-backend change worth its own PR. Tracked separately; this PR is intentionally scoped to the CLI.
Summary verdict: One medium issue should be fixed before merge; no security findings were reported.
Medium
internal/service/usage.go:188: MatchingSessions is computed by translating UsageFilter to SessionFilter, but the filters are not equivalent. The mapping drops ExcludeAgent and model filters, and SessionFilter treats Project/ExcludeProject as single exact values even though usage filters support comma-separated values. This can make matchingSessions positive when the actual usage filter matches no sessions, causing the Copilot no-token-data hint to appear for an empty view.
Fix: Count matching sessions with a query that reuses the usage filter predicates and CSV semantics, or extend SessionFilter and this mapping to preserve all relevant usage filters. Add tests for exclude_agent and multi-project exclusions.
mjacobs
changed the title
feat(usage): explain all-zeros Usage for non-tokenized Copilot sessions (#349)
feat(cli): hint that Copilot usage records no per-message tokens (#349)
Jun 30, 2026
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
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.
GitHub Copilot bills via a monthly premium-request quota rather than per-token, so its session files frequently record no per-message token usage.
usage daily --agent copilotthen shows all-zeros / $0.00 with no explanation, which reads as "spent nothing" (#349).This adds a one-line stderr note from
usage dailywhen the agent filter is an all-Copilot filter and the totals are zero. The agent filter accepts comma-separated lists, soIsCopilotAgentFiltertreats an all-Copilot list (e.g.copilot,vscode-copilot) as Copilot. The note is an agent-property statement shown in response to an explicit--agentthe user typed, so it needs no session-presence check.Scope: this is the CLI half of #349. The dashboard hint is the harder half — to avoid showing it for an empty view it needs a timezone-correct, filter-faithful matching-session count from the sessions table (to distinguish "Copilot sessions with no usage" from "no matching sessions"), which is a cross-backend change worth its own PR. Tracked separately; this PR is intentionally scoped to the CLI.
Where to look
cmd/agentsview/usage.go(noTokenDataNote).internal/db/usage.go(NoTokenData,IsCopilotAgentFilter).