Skip to content

Add Charm Hyper provider - #2379

Open
JavaGT wants to merge 1 commit into
steipete:mainfrom
JavaGT:feat/charm-hyper-provider
Open

Add Charm Hyper provider#2379
JavaGT wants to merge 1 commit into
steipete:mainfrom
JavaGT:feat/charm-hyper-provider

Conversation

@JavaGT

@JavaGT JavaGT commented Jul 21, 2026

Copy link
Copy Markdown

Closes #2318

Summary

  • add Charm Hyper as an API-key provider using GET /v1/credits
  • display the remaining Hypercredit balance without inventing a usage percentage or reset time
  • add settings, token-account, CLI, diagnostics, icon, documentation, and provider-site integration
  • add request/parsing/registration tests

Verification

  • swift build --target CodexBarCore
  • swift build --target CodexBarCLI
  • make format
  • make check passes repository, documentation, locale, generated-hash, and SwiftFormat checks; SwiftLint cannot run on this host because its Command Line Tools installation cannot load sourcekitdInProc.framework
  • focused Swift tests could not execute because this host lacks the Swift Testing module

No live credentials or dashboard cookies are stored in the change.

@clawsweeper

clawsweeper Bot commented Jul 21, 2026

Copy link
Copy Markdown

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.

@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: 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")!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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:

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 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 👍 / 👎.

@steipete

Copy link
Copy Markdown
Owner

Status from maintainer triage: there are currently two Charm Hyper implementations open — this one (GET /v1/credits, remaining Hypercredits) and #2476 (API-key-only, native HC balance, with redacted live proof). Rather than pick blind, we're getting a Charm Hyper account so the behavior can actually be verified before either lands.

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.

@steipete

Copy link
Copy Markdown
Owner

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.

@steipete

Copy link
Copy Markdown
Owner

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 hyper.charm.land session is preferred in Auto mode (imported from Chrome or supplied as a manual Cookie header), falling back to an explicit API key from configuration, HYPER_API_KEY, or a token account. Balance data stays honest — no inferred plan limit, usage percentage, quota, or reset timestamp — and malformed successful responses fail closed rather than hiding an upstream contract change.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Charm Hyper (hyper.charm.land) as a provider

2 participants