[codex] Add Crof provider#872
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fda4bc80c
ℹ️ 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".
| resetsAt: nil, | ||
| resetDescription: creditsDetail) |
There was a problem hiding this comment.
Avoid encoding Crof credit balance as a reset string
Storeing Crof credits in secondary.resetDescription while secondary.resetsAt is nil makes generic renderers print a misleading reset message (e.g., "Resets 10 credits") because UsageFormatter.resetLine prepends "Resets" whenever only resetDescription is present (Sources/CodexBarCore/UsageFormatter.swift, resetLine). This affects paths that were not given Crof-specific overrides (notably CLI/text renderers), so users can see credit balance presented as if it were a reset time.
Useful? React with 👍 / 👎.
4fda4bc to
0a1380f
Compare
0a1380f to
64f2eed
Compare
Summary
Adds Crof as an API-key provider in CodexBar. The new provider calls
GET https://crof.ai/usage_api/with a bearer token, parsescredits,requests_plan, andusable_requests, and renders request quota as the primary usage row with credit balance as the secondary row.The menu keeps the exact request count visible on the right, infers the daily reset from midnight
America/Chicagobased on Crof's current support guidance, and links to the Crof dashboard. The provider also supportsCROF_API_KEY,CROFAI_API_KEY, and the existing~/.codexbar/config.jsonAPI-key flow.Screenshot
Testing
swift test --filter 'CrofUsageFetcherTests|CrofMenuCardTests|CrofProviderImplementationTests|ProviderIconResourcesTests'pnpm checkgit diff --check HEAD~1 HEADNotes
swift testwas not used as the final gate because the existing Mistral date parser test is failing independently on this machine (MistralUsageParserTests.swift:69, expected month 11, got 10).