Open
Conversation
Add support for Abacus AI (ChatLLM/RouteLLM) as a new provider. Uses browser cookie authentication against the describeUser API endpoint to fetch compute point usage. Values are in centi-credits (divided by 100 for display). Primary window shows monthly credit usage as percentage, secondary window shows 7-day usage. Reset date derived from lastBilledAt + 1 month.
- Fix credits format string (Swift String(format:) has no comma flag; use NumberFormatter for thousands separators) - Remove secondary weekly window (Abacus has monthly billing only) - Show credits detail below gauge (follow Warp/Kilo pattern for resetDescription rendering) - Add pace/reserve/deficit estimate on primary monthly window - Remove inactive status page URL (abacus.statuspage.io is inactive) - Hide account email/org from menu (not relevant for display) - Set windowMinutes to 30 days so pace calculation works correctly
- Show pace indicator tick (green/red) on the primary gauge bar - Add reserve/deficit line below gauge with pace right label - Show credits used/total as detail text below the gauge - Restore account identity (email, org, plan tier) in card header
Switch from describeUser (stale centi-credit values, no billing date) to _getOrganizationComputePoints (accurate credits in real units) and _getBillingInfo (exact nextBillingDate and subscription tier). Both endpoints are fetched concurrently.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e316c9d4c7
ℹ️ 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".
Skip browser cookie sets that only contain anonymous/marketing cookies by checking for session/auth cookie names before accepting a set. This prevents using invalid cookies when a valid session exists in a later browser profile. Separate the cookie import and API fetch try blocks so that network, parse, or auth errors from the API are not misreported as "Browser cookie import failed" and incorrectly replaced with noSessionCookie.
Update three call sites that still used the removed UsagePaceText.weeklySummary(provider:window:) and weeklyPaceDetail(provider:window:now:showUsed:) signatures. MenuDescriptor and MenuCardView now use the store.weeklyPace()+ UsagePaceText.weeklySummary(pace:) pattern. StatusItemController computes weeklyPace from primary for Abacus (no secondary window).
Remove Secondary (Weekly) from the menu bar metric picker since Abacus has no secondary window; only Automatic and Primary (Credits) are valid options. Enable pace computation for Abacus in weeklyPace() so the bar tick indicator (reserve/deficit/on-pace) is rendered correctly. Abacus uses the simple UsagePace.weekly() path with the monthly window already set in RateWindow (30 days).
Add docs/abacus.md with setup, API details, and troubleshooting for the Abacus AI provider. Add Abacus AI entry to docs/providers.md strategy table and detailed section. Add Abacus AI to README provider list.
Merge upstream changes including refactored debug log switch (text= → return pattern) and cookieSource/cookieHeader API changes. Add abacus case to updated debug log switch and fix TokenAccountCLI to use new self.cookieSource/self.manualCookieHeader method calls.
Add AbacusProviderTests.swift with 23 tests in 3 suites covering: - AbacusDescriptorTests: provider metadata, source modes, CLI config - AbacusUsageSnapshotTests: credit conversion, formatting, edge cases - AbacusErrorTests: error description completeness Uses the Swift Testing framework (@test + #expect) matching the convention established by recent upstream provider tests.
Author
|
@steipete is there anything else do to for you to approve this PR? |
Resolve conflicts in CostUsageScanner.swift and docs/providers.md to include both .alibaba and .abacus cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_getOrganizationComputePoints(GET) and billing cycle from_getBillingInfo(POST), both called concurrentlyNew files
AbacusProviderDescriptor.swift— provider metadata, branding (cyan), web-only fetch strategyAbacusUsageFetcher.swift— cookie importer, API fetcher, JSON parsingAbacusProviderImplementation.swift— settings UI (cookie source picker)AbacusSettingsStore.swift— settings persistenceProviderIcon-abacus.svg— provider icondocs/abacus.md— provider documentation (setup, API details, troubleshooting)Modified files
Providers.swift—.abacusenum caseProviderSettingsSnapshot.swift—AbacusProviderSettingsProviderDescriptor.swift,ProviderImplementationRegistry.swift— registrationMenuCardView.swift,MenuDescriptor.swift— Abacus-specific display (pace tick, credit detail)UsagePaceText.swift— enable pace calculation for Abacusdocs/providers.md— added Abacus AI to strategy table and detailed provider sectionREADME.md— added Abacus AI to provider listTest plan
codexbar usage --provider abacusai --verboseto verify CLI output