feat(usage): add Grok and OpenCode reporting #5704
Closeddevteapot(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/5704/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- apps/web/src/components/usage/UsagePage.tsx line 557Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -422,10 +487,20 @@422487 }[];423488 readonly duplicateSources: readonly string[];424489 readonly staleEnvironments: readonly string[];425490 readonly isPartial: boolean;491+ readonly environmentFilter: string;492+ readonly providerFilter: string;426493 }) {427494 const failed = environments.filter((environment) => environment.error !== null);428495 const stale = environments.filter((environment) =>429496 staleEnvironments.includes(environment.environmentId),430497 );431- if (failed.length === 0 && stale.length === 0 && duplicateSources.length === 0 && !isPartial) {498+ // Skip notes from environments the merge already dropped, and from499+ // providers the page is not currently focused on.500+ const sourceNotes = [501+ ...new Set(502+ environments503+ .filter((environment) => !staleEnvironments.includes(environment.environmentId))504+ .flatMap((environment) =>505+ (environment.summary?.sources ?? [])506+ .filter(
- apps/server/src/usage/usageTranscripts.ts line 78OutdatedResolvedby devteapot(GitHub profile, opens in a new tab)@@ -68,6 +68,11 @@6868 * an order of magnitude.6969 */7070 export function mightCarryUsage(line: string, provider: UsageProviderKind): boolean {71- return provider === "claude" ? line.includes('"usage"') : line.includes('"token_count"');71+ if (provider === "claude") return line.includes('"usage"');72+ if (provider === "codex") return line.includes('"token_count"');73+ // Grok turn usage lives on `turn_completed` ACP updates.74+ return line.includes('"turn_completed"');7275 }737677+/** Grok reports cost as integer nanodollars (`costUsdTicks`). */78+const GROK_USD_TICKS_PER_DOLLAR = 1_000_000_000;
- @@ -93,3 +109,8 @@93109 );94110 const atom = usageByWindowAtom(windowKey);95111 const environments = useAtomValue(atom);112+ const [environmentFilter, setEnvironmentFilter] = useState<UsageEnvironmentFilter>("all");113+ const [providerFilter, setProviderFilter] = useState<UsageProviderFilter>("all");114+115+ // Drop a stale selection if the environment disconnected.116+ const resolvedFilter = useMemo((): UsageEnvironmentFilter => {
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
f9ee2cbf-2c67-4c52-9480-8a4ed9827a79You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share