Skip to content

feat(core): expand pi session attribution and reported cost handling - #2575

Closed
Yuxin-Qiao wants to merge 2 commits into
steipete:mainfrom
Yuxin-Qiao:feat/pi-local-session-costs
Closed

feat(core): expand pi session attribution and reported cost handling#2575
Yuxin-Qiao wants to merge 2 commits into
steipete:mainfrom
Yuxin-Qiao:feat/pi-local-session-costs

Conversation

@Yuxin-Qiao

Copy link
Copy Markdown
Contributor

Summary

Extends the existing Pi session scanner from a partial two-provider integration into full local usage attribution:

  • Reported cost priority: prefers pi's exact per-message usage.cost.total over models.dev estimates, falling back only when the session omits cost or reports zero.
  • Provider attribution: maps pi providers onto their CodexBar counterparts (DeepSeek, Gemini, xAI, OpenRouter, Kimi, MiniMax, Qwen, Zai, OpenCode, Copilot, Mistral, Groq, Bedrock, Azure OpenAI, MiMo, ...). Unmapped providers are ignored instead of miscounted.
  • Response model pricing: uses message.responseModel when present (e.g. OpenRouter auto routing) so the actual model is priced and shown in breakdowns.
  • Tools/summaries: tool-result, compaction, and branch-summary usage is bucketed under Tools/summaries, matching pi's own session totals.
  • Merge pipeline: pi reports now merge into every mapped provider on the local token snapshot pipeline (Codex, Claude, Vertex AI, Bedrock), not only Claude/Codex.
  • Cache/schema: pi session cache schema bumps to pi-sessions-v9.json; costFormulaVersion bumps to 2 so existing caches rescan.
  • Docs: adds docs/pi.md and updates docs/codex.md, docs/claude.md, and the cost CLI help.

Test

  • PiSessionCostScannerTests: official cost priority + zero-cost fallback, responseModel routing, Tools/summaries bucketing, DeepSeek/xAI/Gemini attribution, third-party pricing-key invalidation, v8→v9 cache migration.
  • CostUsageFetcherTests + CostUsageFetcherCacheSnapshotTests: merge behavior unchanged and green.
  • New TestsLinux/PiSessionCostScannerLinuxTests.swift covers provider mapping without network.
  • make check (swiftformat + swiftlint strict + parser hash + package checks) passes.

Verification ran on a clean worktree off main; the working checkout contains unrelated uncommitted WIP, so it was excluded from the PR branch.

@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: e8b6c1a419

ℹ️ 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 on lines +337 to 338
if includePiSessions, PiSessionCostScanner.mappedTargetProviders.contains(provider), shouldMergePiUsage {
let piReport = try PiSessionCostScanner.loadDailyReportCancellable(

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 Merge Bedrock pi usage before returning remote costs

For every Bedrock request, loadRemoteTokenSnapshot constructs a non-nil snapshot and the caller returns it at lines 238-245, so execution never reaches this new merge branch. Consequently, includePiSessions: true still omits all amazon-bedrock pi/OMP sessions from Bedrock cost output; the remote Bedrock report needs to be combined with the pi report rather than returned early.

Useful? React with 👍 / 👎.

Comment on lines +885 to +887
let total = self.readNonNegativeDouble(cost["total"])
if let total {
return Int64((total * Self.costScale).rounded())

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 Reject reported costs that overflow Int64

When a malformed pi/OMP row supplies usage.cost.total above roughly $9.22 billion, readNonNegativeDouble accepts it because its upper bound is approximately Int.max, but multiplying by one billion and converting to Int64 traps at runtime. Since this fatal conversion is not catchable by the surrounding JSONL scan, one corrupt cost value crashes the entire cost scan/app instead of being ignored; validate against Double(Int64.max) / costScale before converting.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 11:13 AM ET / 15:13 UTC.

ClawSweeper review

What this changes

This PR expands Pi/OMP local-session cost attribution to more existing providers, prefers Pi-reported message costs, adds tool-summary and response-model handling, and updates the cache, tests, CLI help, and documentation.

Merge readiness

Blocked until real behavior proof is added - 13 items remain

Keep this PR open, but it is not ready to merge: the expanded mapping is blocked by the existing snapshot gate, Bedrock still returns before merging local Pi usage, malformed reported costs can trap the scanner, and OpenAI fallback pricing is missing. It also needs redacted after-fix runtime proof in addition to its unit-test claims.

Priority: P2
Reviewed head: 59b8e75b65ad69b804ebce61011277c5abb0c2c7

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The change has substantial focused tests and documentation, but four concrete correctness defects plus missing real behavior proof leave it below merge-ready quality.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR body reports unit tests and make check, but the supplied discussion contains no inspectable after-fix local CLI or runtime output demonstrating the expanded attribution behavior. Add redacted live output for at least one mapped provider and a reported-cost or Bedrock case; redact account names, paths, tokens, and other private data, then update the PR body for re-review.
Patch quality 🦪 silver shellfish (2/6) 4 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports unit tests and make check, but the supplied discussion contains no inspectable after-fix local CLI or runtime output demonstrating the expanded attribution behavior. Add redacted live output for at least one mapped provider and a reported-cost or Bedrock case; redact account names, paths, tokens, and other private data, then update the PR body for re-review.
Evidence reviewed 6 items Snapshot entry gate blocks the newly mapped providers: The PR changes the Pi merge condition to recognize every mapped provider, but loadTokenSnapshot rejects any provider outside the pre-existing .codex, .claude, .vertexai, and .bedrock support set before that condition can run. The proposed DeepSeek, Gemini, xAI, OpenAI, and other mappings therefore cannot reach the advertised token-snapshot pipeline.
Bedrock’s remote return bypasses Pi merging: The PR still returns a non-nil Bedrock remote snapshot before entering the new local Pi merge block, so amazon-bedrock Pi/OMP usage remains absent whenever the Bedrock remote report is available.
Reported-cost conversion remains unsafe: The new reported-cost path accepts finite values through approximately Int.max dollars, then multiplies by one billion and converts to Int64; values above about $9.22 billion overflow that conversion and can crash the synchronous local scan.
Findings 4 actionable findings [P1] Expose mapped providers through the snapshot entry point
[P2] Merge Bedrock Pi usage before returning the remote snapshot
[P2] Bound reported costs before converting them to nanos
Security None None.

How this fits together

CodexBar’s local cost pipeline accepts a selected provider, optionally obtains remote usage, scans native and Pi/OMP session logs, and returns a merged token-cost snapshot to the CLI and app. Pi session records are mapped to CodexBar providers and priced from either Pi’s recorded cost or the models.dev pricing catalog.

flowchart TD
    A[Selected provider] --> B[Token snapshot entry]
    B --> C[Remote usage lookup]
    B --> D[Local native log scan]
    B --> E[Pi and OMP session scan]
    E --> F[Provider mapping and cost pricing]
    C --> G[Merge daily cost reports]
    D --> G
    F --> G
    G --> H[CLI and app cost history]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports unit tests and make check, but the supplied discussion contains no inspectable after-fix local CLI or runtime output demonstrating the expanded attribution behavior. Add redacted live output for at least one mapped provider and a reported-cost or Bedrock case; redact account names, paths, tokens, and other private data, then update the PR body for re-review.
  • Expose mapped providers through the snapshot entry point (P1) - The new merge block is unreachable for every newly mapped provider because loadTokenSnapshot first rejects providers outside the four-value supportsTokenSnapshot set. Extend the supported local-cost path (or narrow the documented mapping) so DeepSeek, Gemini, xAI, OpenAI, and the other advertised mappings can actually produce a snapshot.
  • Merge Bedrock Pi usage before returning the remote snapshot (P2) - Bedrock still returns its non-nil remote snapshot before execution reaches this newly expanded Pi merge path. As a result, amazon-bedrock Pi/OMP rows remain missing whenever the remote report is available; combine the daily reports before creating the returned snapshot.
  • Bound reported costs before converting them to nanos (P2) - readNonNegativeDouble accepts values up to roughly Int.max, but this new conversion multiplies the value by one billion and casts it to Int64. A malformed local value above about $9.22 billion traps instead of being ignored; validate against Double(Int64.max) / costScale before conversion.
  • Price mapped OpenAI sessions through the fallback catalog (P2) - Pi provider openai now maps to .openai, but this provider-ID switch has no .openai entry. When Pi omits or reports zero cost, otherwise priceable OpenAI rows fall through to nil rather than using the documented models.dev fallback.
  • Resolve merge risk (P1) - Existing mapped providers other than Codex, Claude, Vertex AI, and Bedrock remain unavailable through the public token-snapshot entry point, so the PR’s principal provider-expansion claim is not observable there.
  • Resolve merge risk (P1) - Bedrock can silently omit local Pi/OMP usage whenever its remote usage report exists, producing incomplete totals rather than a visible error.
  • Resolve merge risk (P1) - A malformed local session cost can overflow conversion to nanos and crash the cost scan.
  • Resolve merge risk (P2) - OpenAI Pi rows without Pi-reported cost lose the advertised models.dev fallback and show no price.
  • Resolve merge risk (P1) - The PR has no inspectable after-fix runtime output demonstrating a mapped provider, reported-cost precedence, or Bedrock merge; test and CI claims are supplemental only.
  • Complete next step (P2) - The remaining blockers are four concrete, bounded code-path defects with clear implementation and regression-test locations; real runtime proof must still come from a contributor or maintainer after repair.
  • Improve patch quality - Repair the four source-backed findings and add focused regressions for the entry gate, Bedrock merge, OpenAI fallback, and overflow boundary.
  • Improve patch quality - Post redacted after-fix CLI/runtime output showing a mapped provider’s attributed cost; update the PR body to trigger a fresh review or ask a maintainer to comment @clawsweeper re-review.

Findings

  • [P1] Expose mapped providers through the snapshot entry point — Sources/CodexBarCore/CostUsageFetcher.swift:337
  • [P2] Merge Bedrock Pi usage before returning the remote snapshot — Sources/CodexBarCore/CostUsageFetcher.swift:337-350
  • [P2] Bound reported costs before converting them to nanos — Sources/CodexBarCore/PiSessionCostScanner.swift:883-898
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 10 files affected; 804 added, 63 removed The provider expansion changes scanner, integration, cache, tests, CLI help, and documentation rather than a single isolated parser path.
Unresolved functional defects 4 source-backed findings Two prior pipeline defects remain and two scanner pricing/safety defects prevent the claimed behavior from being reliable.

Merge-risk options

Maintainer options:

  1. Repair the expanded snapshot path (recommended)
    Allow the intended mapped providers through the local snapshot entry point, merge Pi usage into Bedrock’s remote report, and cover both paths with focused tests before merge.
  2. Narrow the PR to supported providers
    Keep the existing Codex and Claude behavior only, removing claims and mappings that cannot yet be reached through the supported token-snapshot API.
  3. Pause the expansion
    Close or defer this broad attribution extension if maintainers do not want to expand the supported local-cost provider contract at this time.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve existing provider behavior while enabling only the documented Pi mappings; add regression coverage for the snapshot gate, Bedrock remote-plus-Pi merge, OpenAI pricing fallback, and overflow-safe reported costs.

Technical review

Best possible solution:

Route all mapped Pi providers through a deliberately supported local-cost snapshot path, merge Pi usage with remote Bedrock output before snapshot creation, bound malformed costs safely, and add focused regressions plus redacted live output proving the repaired provider and cost paths.

Do we have a high-confidence way to reproduce the issue?

Yes, for the four review defects by source inspection: the token-snapshot gate and Bedrock early return deterministically bypass the new merge block, while the scanner’s conversion and provider-ID switch show the overflow and OpenAI fallback gaps. No live account probe was run because this review is read-only and repository policy prefers non-Keychain parser validation.

Is this the best way to solve the issue?

No. The proposed mapping table and scanner updates are directionally consistent with the existing Pi pipeline, but the implementation must repair the entry-point, remote-merge, pricing-fallback, and numeric-boundary paths before it can provide the advertised behavior safely.

Full review comments:

  • [P1] Expose mapped providers through the snapshot entry point — Sources/CodexBarCore/CostUsageFetcher.swift:337
    The new merge block is unreachable for every newly mapped provider because loadTokenSnapshot first rejects providers outside the four-value supportsTokenSnapshot set. Extend the supported local-cost path (or narrow the documented mapping) so DeepSeek, Gemini, xAI, OpenAI, and the other advertised mappings can actually produce a snapshot.
    Confidence: 0.99
  • [P2] Merge Bedrock Pi usage before returning the remote snapshot — Sources/CodexBarCore/CostUsageFetcher.swift:337-350
    Bedrock still returns its non-nil remote snapshot before execution reaches this newly expanded Pi merge path. As a result, amazon-bedrock Pi/OMP rows remain missing whenever the remote report is available; combine the daily reports before creating the returned snapshot.
    Confidence: 0.99
  • [P2] Bound reported costs before converting them to nanos — Sources/CodexBarCore/PiSessionCostScanner.swift:883-898
    readNonNegativeDouble accepts values up to roughly Int.max, but this new conversion multiplies the value by one billion and casts it to Int64. A malformed local value above about $9.22 billion traps instead of being ignored; validate against Double(Int64.max) / costScale before conversion.
    Confidence: 0.99
  • [P2] Price mapped OpenAI sessions through the fallback catalog — Sources/CodexBarCore/PiSessionCostScanner.swift:951-974
    Pi provider openai now maps to .openai, but this provider-ID switch has no .openai entry. When Pi omits or reports zero cost, otherwise priceable OpenAI rows fall through to nil rather than using the documented models.dev fallback.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2bd6a6c37eff.

Labels

Label justifications:

  • P2: This is a normal-priority local cost-reporting expansion with concrete correctness gaps but no evidence of an active broad user outage.
  • merge-risk: 🚨 compatibility: The PR changes which providers are attributed and priced, but the public snapshot support boundary and OpenAI fallback do not match the new documented behavior.
  • merge-risk: 🚨 availability: The new reported-cost conversion can trap on malformed local JSONL cost values and interrupt the cost scan.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports unit tests and make check, but the supplied discussion contains no inspectable after-fix local CLI or runtime output demonstrating the expanded attribution behavior. Add redacted live output for at least one mapped provider and a reported-cost or Bedrock case; redact account names, paths, tokens, and other private data, then update the PR body for re-review.

Evidence

Acceptance criteria:

  • [P1] swift test --filter PiSessionCostScannerTests.
  • [P1] swift test --filter CostUsageFetcherTests.
  • [P1] swift test --filter CostUsageFetcherCacheSnapshotTests.
  • [P1] make check.

What I checked:

  • Snapshot entry gate blocks the newly mapped providers: The PR changes the Pi merge condition to recognize every mapped provider, but loadTokenSnapshot rejects any provider outside the pre-existing .codex, .claude, .vertexai, and .bedrock support set before that condition can run. The proposed DeepSeek, Gemini, xAI, OpenAI, and other mappings therefore cannot reach the advertised token-snapshot pipeline. (Sources/CodexBarCore/CostUsageFetcher.swift:337, 59b8e75b65ad)
  • Bedrock’s remote return bypasses Pi merging: The PR still returns a non-nil Bedrock remote snapshot before entering the new local Pi merge block, so amazon-bedrock Pi/OMP usage remains absent whenever the Bedrock remote report is available. (Sources/CodexBarCore/CostUsageFetcher.swift:337, 59b8e75b65ad)
  • Reported-cost conversion remains unsafe: The new reported-cost path accepts finite values through approximately Int.max dollars, then multiplies by one billion and converts to Int64; values above about $9.22 billion overflow that conversion and can crash the synchronous local scan. (Sources/CodexBarCore/PiSessionCostScanner.swift:887, 59b8e75b65ad)
  • OpenAI mapping lacks documented pricing fallback: Pi provider openai maps to .openai, but the new models.dev provider-ID switch has no .openai case. Rows without a positive Pi-reported cost therefore remain unpriced instead of using the stated models.dev fallback. (Sources/CodexBarCore/PiSessionCostScanner.swift:953, 59b8e75b65ad)
  • Relevant current-main feature history: Current-main history attributes the Pi/OMP scanner’s initial OMP session support to Kevin Mahoney, later deduplication work to Peter Steinberger, and the most recent scanner invalidation work to Milan Mijatovic. (Sources/CodexBarCore/PiSessionCostScanner.swift:1, cdab5d32b533)
  • Diff scope and hygiene: The branch changes 10 files with 804 additions and 63 deletions, and git diff --check reported no whitespace errors. No package manifest or lockfile changes are in the diff. (Sources/CodexBarCore/PiSessionCostScanner.swift:1, 59b8e75b65ad)

Likely related people:

  • Peter Steinberger: Current-main history shows Peter’s Pi-compatible session deduplication fix, directly adjacent to the cache and scanner behavior this PR extends. (role: recent Pi-session feature contributor; confidence: high; commits: ab1f76269601; files: Sources/CodexBarCore/PiSessionCostScanner.swift)
  • Milan Mijatovic: The most recent current-main history entry for the Pi scanner is Milan’s cost-usage time-zone invalidation repair, making this a strong routing candidate for cache and scan semantics. (role: recent scanner maintainer; confidence: high; commits: cdab5d32b533; files: Sources/CodexBarCore/PiSessionCostScanner.swift, Sources/CodexBarCore/CostUsageFetcher.swift)
  • Kevin Mahoney: Current-main history records the feature that introduced OMP session costs, which shares the local session ingestion surface expanded here. (role: introduced adjacent OMP-session behavior; confidence: medium; commits: dd290c27f413; files: Sources/CodexBarCore/PiSessionCostScanner.swift)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-08-02T11:11:03.242Z sha e8b6c1a :: needs real behavior proof before merge. :: [P1] Expose mapped providers through the cost entry points | [P2] Merge Bedrock pi usage before returning remote costs | [P2] Clamp reported costs before nanos conversion
  • reviewed 2026-08-02T11:30:33.450Z sha e8b6c1a :: needs real behavior proof before merge. :: [P1] Expose mapped providers through the cost entry points | [P2] Merge Bedrock Pi usage before returning remote costs | [P2] Reject reported costs that overflow nanos conversion
  • reviewed 2026-08-02T12:55:22.435Z sha 7bb7910 :: needs real behavior proof before merge. :: [P1] Allow mapped providers through the snapshot gate | [P2] Merge Pi usage with remote Bedrock snapshots | [P2] Bound reported costs before converting to Int64 nanos

- Prefer pi's exact per-message usage.cost over models.dev estimates, falling back only when absent or zero.
- Attribute pi providers to their CodexBar counterparts (DeepSeek, Gemini, xAI, OpenRouter, Kimi, MiniMax, Qwen, Zai, OpenCode, Copilot, Mistral, Groq, Bedrock, Azure OpenAI, MiMo, ...).
- Use message.responseModel for OpenRouter auto-style routing and price the actual model.
- Bucket tool-result, compaction, and branch-summary usage under Tools/summaries.
- Merge pi reports into every mapped provider on the local token snapshot pipeline, not just Claude/Codex.
- Bump pi session cache schema to v9 and cost formula version to 2.
- Add docs/pi.md and Linux scanner coverage.
@Yuxin-Qiao
Yuxin-Qiao force-pushed the feat/pi-local-session-costs branch from 7bb7910 to 59b8e75 Compare August 2, 2026 15:02

@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: 59b8e75b65

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

// swiftlint:disable:next cyclomatic_complexity
private static func modelsDevProviderID(for provider: UsageProvider) -> String? {
switch provider {
case .codex: "openai"

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 Map OpenAI sessions to OpenAI pricing

When a pi row uses provider openai and omits usage.cost.total or reports zero, it is attributed to .openai, but this switch only maps .codex to the openai models.dev catalog and lets .openai fall through to nil. Consequently, otherwise priceable OpenAI rows remain unpriced instead of using the documented models.dev fallback; add the .openai case to this mapping.

Useful? React with 👍 / 👎.

@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Maintainer decision on the Usage & Spend program (applies to #2322, #2527, #2548, #2569, #2575, #2577 — closing together):

We want the ideas — the token-activity view and the cross-provider cost overview in particular are genuinely good, and we're adopting them. What we can't absorb is the delivery shape: 8k–20k-line PRs bundling scanners, pricing, identity, and UI can't be reviewed honestly, and live testing of the current heads surfaced the kind of defects that big surfaces hide (duplicate token-activity cards in the Models view; the unified Overview rendering no chip for an enabled provider; the account-attribution issue flagged earlier).

So we're taking this work as a base in-house and rebuilding it in small, individually landable slices — first the token-activity view rebuilt on the shared scan cache (no separate annual scan), then the cost overview aligned with the #2578 design discussion. Your commits will be cherry-picked where they fit, and every slice that draws on this work will credit you in the changelog, as today's merges already do.

@Yuxin-Qiao — you're this repo's most prolific contributor and much of today's release is your work. Focused PRs the size of #2574 land same-day; that's the shape that serves both of us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants