Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move usage parsing out of ClaudeClient into a pure claude-parse module and add extra-usage / prepaid-balance parsing (cents -> major units). Legacy session/weekly fields now apply only when the new utilization is absent, so a real 0% is no longer overridden. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…points Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…resh Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cards render a shared "Add-on credits" section (Claude prepaid balance and extra usage, OpenAI credit balance) and the Monitor strip shows a one-line credit summary. Usage hooks no longer gate on /api/health: the routes report MISSING_CREDENTIALS themselves, which drives the setup placeholder and skips SWR retries. Refresh bypasses the server cache via ?fresh=1, and Settings distinguishes configured-but-failing from not configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rage flag Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also fixes the test:edge script (node --test with a directory path fails on Node 22). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssing
The Keychain probe now distinguishes absent from expired
(readClaudeCodeOAuthState). With no session key, an expired token yields
401 AUTH_EXPIRED ("Claude Code sign-in expired. Run `claude` ..."), so
health stays configured and the card keeps its last data. An expired
result caches for 60 s instead of 5 min, and a cached valid token never
outlives its own expiresAt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SWR suppresses refreshInterval while an error is cached, so onErrorRetry now drives polling: MISSING_CREDENTIALS rechecks every usage interval, other errors use SWR's backoff capped at that interval (usageRetryDelay). Cards no longer flash the skeleton during error retries, drop the "Connected" badge while erroring, and show the setup placeholder on MISSING_CREDENTIALS even over stale data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude parser accepts finite numeric strings for monthly_limit, used_credits, utilization and prepaid amount. OpenAI "N credits" only shows when hasCredits is true (unlimited still wins). Settings explains when the session key is optional; README clarifies the "Out of credits" pill, documents the expired Claude Code sign-in, and bumps the test count. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SWR starts a new retry chain for each failed non-deduped request, so a focus revalidation or Refresh during an outage stacked another never-ending <=60 s chain. scheduleRetry() cancels any pending retry for the key before scheduling the next. README: expired sign-in is picked up "within a minute or two"; test count 295. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ConnectionBadge only knew connected:boolean, so a card showing a real error (e.g. "Claude Code sign-in expired") still read "Not configured". It now takes a status of connected | error | unconfigured, and ProviderCard derives it from connected and error. Page headers on the dashboard, monitor and settings pages used a non-wrapping flex row, so the title block and nav buttons overflowed at 375px. They now wrap, matching the analytics header. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
next build typechecks every .ts in the context, and src/app/api/__tests__/edge-contract.test.ts imports edge/, which .dockerignore already excludes — so docker build failed with TS2307. Tests never run in the image, so exclude them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Tracks how much add-on credit is left on both subscriptions and shows it beside the quota bars.
wham/usage→credits("N credits", "Unlimited", "Credits available"), plus a Depleted pill when the workspace's credits run out or the overage limit is reached.Verified against the live ChatGPT response; it rendered 60,740.28 credits. The Claude field shapes (cents, currency) come from the open-source Codex CLI and several community trackers. The parser treats every field as optional and accepts amounts sent as numeric strings.
Hardening found along the way
claude-parse.ts,openai-parse.ts). Clients only fetch now. The credit endpoints are best-effort and can never fail the quota card.rate_limit_reached_typeis an object in the live payload, so the old code would have thrown. Fixed and tested.claudeto refresh"), not "not configured".usage-service.tsgives typed results:MISSING_CREDENTIALS401,AUTH_EXPIRED401,FETCH_ERROR502. The routes and/api/healthare thin wrappers, and health entries are now{configured, connected, error?, code?}.?fresh=1.CLAUDE_CODE_USER_AGENTandCLAUDE_WEB_USER_AGENT.execFile(no shell), shares one in-flight call, and honoursexpiresAt.tsc --noEmit, the edge tests andnpm run build. Thetest:edgescript was fixed because it failed on Node 22.@types/node^22.Verification
npx vitest run: 295 passed.tsc --noEmitand lint are clean,npm run test:edge84/84, andnpm run buildsucceeds.Reviewer notes
docs/superpowers/specs/2026-10-20-addon-credit-tracking-design.mdanddocs/superpowers/plans/2026-10-20-addon-credit-tracking.md.🤖 Generated with Claude Code