Add DeepInfra usage provider#2238
Conversation
|
Live validation completed against a real DeepInfra account using a dedicated temporary API token:
The API token was not shared with tests or CI. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21bb74d801
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Codex review: needs changes before merge. Reviewed July 17, 2026, 5:20 PM ET / 21:20 UTC. Summary Reproducibility: yes. in source: create a suspended DeepInfra snapshot whose detail begins with suspension text and call the automatic metric renderer; its Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: If maintainers sponsor DeepInfra as a core provider, preserve the balance extraction for suspended snapshots and add focused coverage for both available and owed suspended states before merge. Do we have a high-confidence way to reproduce the issue? Yes, in source: create a suspended DeepInfra snapshot whose detail begins with suspension text and call the automatic metric renderer; its Is this the best way to solve the issue? No, not yet: the overall provider approach fits the existing API-token architecture, but the menu-bar renderer must tolerate the documented suspension prefix and maintainers must explicitly accept the new core provider surface. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0844c878a9bc. Label changesLabel changes:
Label justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
# Conflicts: # Sources/CodexBar/MenuCardView.swift # Sources/CodexBar/MenuDescriptor.swift # Sources/CodexBar/SettingsStore+MenuPreferences.swift # Sources/CodexBar/UsageStore.swift # Sources/CodexBarCore/Config/ProviderConfigEnvironment.swift # Sources/CodexBarCore/Generated/CodexParserHash.generated.swift # Sources/CodexBarCore/Vendored/CostUsage/CostUsageScanner.swift # docs/cli.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba1c79884
ℹ️ 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".
| guard | ||
| let detail = snapshot?.primary?.resetDescription? | ||
| .trimmingCharacters(in: .whitespacesAndNewlines), | ||
| detail.hasPrefix("$"), |
There was a problem hiding this comment.
Preserve suspended DeepInfra balance in menu bar
When DeepInfra reports a suspended account, DeepInfraUsageSnapshot.toUsageSnapshot() prefixes resetDescription with Suspended... before the $… available/owed text. This guard then fails because the detail no longer starts with $, so the automatic menu-bar metric falls back to the exhausted 0% window instead of showing the balance/owed amount for exactly the suspended accounts this code handles.
Useful? React with 👍 / 👎.
|
Merged after maintainer verification. Security/API review:
Local proof on exact head
Live probe: unavailable because no maintainer-owned DeepInfra credential was authorized. The contributor's prior temporary-token screenshot on this PR showed the expected prepaid balance and monthly-spend presentation. Fresh maintainer proof used synthetic payloads, source-blind validation, and CI. CI: run 29614208110 passed on the exact head: lint, Linux x64/arm64 builds and tests, both macOS shards, aggregate gate, and GitGuardian. One unrelated Kiro prompt-return timing assertion exceeded its 8-second ceiling by 0.62 seconds on the first macOS shard-1 attempt; the exact-head failed-job retry passed. Merged as |


Summary
Testing
Local make test is blocked because this Mac has Swift 6.0.3 while CodexBar and SweetCookieKit require Swift 6.2. The supported Xcode 26.3 fork workflow compiled the production and test targets successfully. No live API token is accessed by tests or CI.