Port Upstream Accuracy and Pricing Fixes - #113
Conversation
Re-implement the OpenUsage commits that fix real usage gaps without adding new metrics or fighting Runway's architecture: Desktop account-prefixed caches, Claude spend without OAuth, Grok subagent ledgers, Codex Business Premium, Cursor Models/Other Models labels, and new model rates.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
🟡 Changes recommended
ClaudeDesktopAuthStore.selectCredential now passes Dictionary.filter(...) into a function expecting a Dictionary, which will not type-check without converting the filtered result back to [CacheKey: Any].
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Ports a targeted set of upstream accuracy/pricing fixes into Runway’s SwiftUI macOS app, improving provider log scanning and pricing resolution while keeping UI/widget identities stable.
Changes:
- Updates Claude Desktop auth selection (account-prefixed token cache keys) and allows unauthenticated Claude refreshes to still surface local spend tiles when logs exist.
- Expands Grok local session scanning to include subagent/resumed ledgers and updates Cursor/Codex labeling/mapping to match upstream naming and entitlements.
- Extends
pricing_supplement.jsonwith new model rates/aliases and adds/updates regression tests and docs accordingly.
File summaries
| File | Description |
|---|---|
| Tests/RunwayTests/PricingBundledResourceTests.swift | Adds assertions for new supplement-priced models and aliases. |
| Tests/RunwayTests/GrokLogUsageScannerTests.swift | Updates expectations to include subagent session usage while deduplicating fork replays. |
| Tests/RunwayTests/CursorUsageSummaryTests.swift | Renames expected Cursor usage line labels to “Cursor models” / “Other models”. |
| Tests/RunwayTests/CursorProviderTests.swift | Updates Cursor mapper/provider tests for renamed labels while keeping IDs stable. |
| Tests/RunwayTests/CodexProviderTests.swift | Adds regression coverage for Business Premium entitlement mapping. |
| Tests/RunwayTests/ClaudeProviderTests.swift | Adds coverage for unauthenticated Claude refresh still showing local spend when logs exist. |
| Tests/RunwayTests/ClaudeDesktopAuthStoreTests.swift | Adds coverage for account-prefixed Desktop token caches and tombstone behavior. |
| Sources/Runway/Resources/pricing_supplement.json | Adds new model rates, fast multiplier, and alias rules (Gemini 3.8 Flash, GPT-6 Astra, Fable 5.1, GLM 5.3, grok-bot slugs). |
| Sources/Runway/Providers/Grok/GrokLogUsageScanner.swift | Switches session discovery to include all updates.jsonl ledgers (including subagents/resumes). |
| Sources/Runway/Providers/Cursor/CursorUsageSummaryMapper.swift | Renames Cursor plan usage labels to match Cursor dashboard terminology. |
| Sources/Runway/Providers/Cursor/CursorUsageMapper.swift | Renames Cursor usage meter labels to “Cursor models” / “Other models”. |
| Sources/Runway/Providers/Cursor/CursorProvider.swift | Renames Cursor metric titles/labels while preserving widget IDs. |
| Sources/Runway/Providers/Codex/CodexUsageMapper.swift | Maps self_serve_business_prolite to “Business Premium”. |
| Sources/Runway/Providers/Claude/ClaudeProvider.swift | Uses local log scan for unauthenticated installs; only shows hard error when there’s no local usage. |
| Sources/Runway/Providers/Claude/ClaudeDesktopAuthStore.swift | Implements account-prefixed Desktop cache normalization and selection. |
| README.md | Updates Cursor feature blurb to new metric naming. |
| docs/providers/grok.md | Updates Grok spend-tile description to reflect inclusion of subagent/resumed sessions. |
| docs/providers/cursor.md | Renames documented Cursor meters to “Cursor Models” / “Other Models”. |
| docs/providers/codex.md | Documents Business Premium mapping for self_serve_business_prolite. |
| docs/providers/claude.md | Documents account-prefixed Desktop tokens and unauthenticated local spend behavior. |
| docs/menu-bar.md | Updates default-star naming for the renamed Cursor metrics. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TL;DR
Selective re-implementation of the OpenUsage commits since Runway #111 that still apply: Claude Desktop's account-prefixed token caches, Claude spend tiles without an OAuth login, Grok subagent session ledgers, Codex Business Premium, Cursor's Models/Other Models labels, and new model rates.
What was happening
acct:<user>|<legacy key>(openusage Fix Claude Desktop Account-Prefixed Credential Caches robinebers/openusage#1212). Runway expected the client UUID first and skipped those entries, so a Desktop-only login showed Not logged in.subagent*session (openusage fix(grok): include subagent session usage robinebers/openusage#1193). Child work that the coordinator turn did not include disappeared from spend.self_serve_business_proliteentitlement rendered as "Self Serve Business Prolite" (openusage fix(codex): recognize Business Premium entitlement robinebers/openusage#1194).What this changes
acct:<user>|prefix, keeps only the signed-in account (fromlastKnownAccountUuid), and lets a scoped tombstone suppress the matching legacy V1 alias.updates.jsonlledger. Prompt-id dedup still drops forked parent replays.summary.jsonis no longer required to keep a ledger.self_serve_business_proliteto Business Premium.grok-bot-*→ Grok 4.6.Heads-up
Reviewed and not ported, with reasons:
ReorderFrameStore, parsed-onceProviderMark, and the rebuilt popover path. Taking their patch would duplicate that work.grok-bot-*pricing aliases.used <= 0,Pace.evaluatereturns nil when unused).Gemini 3.8 Flash output is $3.50, from Cursor's table, not upstream's $3.75 Google API rate. That matches how Runway priced Gemini 3.7.
Tests
acct:keys are ignored; a scoped V2 tombstone suppresses the V1 alias;load()readslastKnownAccountUuid.self_serve_business_prolite→ Business Premium, weekly-only window.testEveryAliasCanonicalResolvescovers the new rules.swift test --filter "ClaudeDesktopAuthStoreTests|ClaudeProviderTests|CursorProviderTests|CursorUsageSummaryTests|GrokLogUsageScannerTests|CodexUsageMapperTests|PricingBundledResourceTests|LayoutStoreTests"— 179 tests, 1 skipped, 0 failures.