Add Charm Hyper provider - #2379
Conversation
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: Add Charm Hyper provider This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c876892b5
ℹ️ 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".
|
|
||
| public struct HyperUsageFetcher: Sendable { | ||
| private static let log = CodexBarLog.logger(LogCategories.hyperUsage) | ||
| private static let creditsURL = URL(string: "https://api.hyper.charm.land/v1/credits")! |
There was a problem hiding this comment.
Use the public Hyper credits host
When any Hyper API key is configured, every refresh calls this hard-coded api.hyper.charm.land endpoint, but Charm's maintained Hyper provider defines the base as https://hyper.charm.land and fetches ${hyperApiBaseUrl()}/credits (hyper.ts, credits.ts). Unless the undocumented api. alias happens to exist, all Hyper users will get network/API failures instead of a balance; point the fetcher at https://hyper.charm.land/v1/credits or share the same configurable base URL.
Useful? React with 👍 / 👎.
| private static func usesDetailBackedWindow(provider: UsageProvider) -> Bool { | ||
| switch provider { | ||
| case .warp, .kilo, .mistral, .deepseek, .deepinfra, .qoder, .crof: | ||
| case .warp, .kilo, .mistral, .deepseek, .deepinfra, .qoder, .crof, .hyper: |
There was a problem hiding this comment.
Render Hyper as a balance in the CLI
Adding Hyper only to the detail-backed-window list does not change balance-only output, because that path is used only for RateWindows and HyperUsageSnapshot sets primary/secondary to nil. For codexbar usage --provider hyper, collectCardExtraLines therefore falls back to the generic provider-cost branch and prints something like Cost: 42.0 / 0.0 rather than the remaining Hypercredit balance; add a Hyper-specific CLI balance line instead of routing it through the rate-window detail helper.
Useful? React with 👍 / 👎.
|
Status from maintainer triage: there are currently two Charm Hyper implementations open — this one ( Direction we're leaning, so you both know where this is heading: support both auth paths rather than choosing one — if an API key is present, infer usage from it; if the user signs in, prefer the session (richer data). That mirrors how most CodexBar providers already work. Once we can test against a real account we'll converge the two PRs into that shape, with credit to both of you. Keeping this open meanwhile — thanks for your patience @JavaGT. |
|
Update on Charm Hyper: Peter is on the Charm Hyper waitlist, so we can't verify either implementation against a live account just yet. Rather than leave two competing PRs sitting stale, we're combining them into a single new PR that implements both auth paths:
Both of you will be credited as co-authors on the combined PR. It'll be prepared, tested, and CI-green so it can merge the moment account access comes through and the live behavior checks out. We'll link it here when it's up — thanks for the work and the patience, @JavaGT and @akshayprabhu200. |
|
The combined Charm Hyper PR is up: #2502 — "Add Charm Hyper provider (API key + session)". It implements both auth paths as planned: a signed-in Both of you are recorded as co-authors on the combined commit, and the PR credits #2379 and #2476 explicitly. It is not merging yet: Peter is on the Charm Hyper waitlist, so nobody has confirmed the behavior against a real account. Once access lands we'll verify session auth, the session-over-key preference and fallback, API/session balance parity, and HC rendering — then it goes in. CI is green apart from one macOS shard still queued. Keeping #2379 and #2476 open for now so you can review the combined result and flag anything we got wrong about your implementations. |
Closes #2318
Summary
GET /v1/creditsVerification
swift build --target CodexBarCoreswift build --target CodexBarCLImake formatmake checkpasses repository, documentation, locale, generated-hash, and SwiftFormat checks; SwiftLint cannot run on this host because its Command Line Tools installation cannot loadsourcekitdInProc.frameworkNo live credentials or dashboard cookies are stored in the change.