Conversation
Adds the Raycast AI credits provider (cookie-backed frontend_api/current_user/ai_credits), its cookie-source options, icons, catalog registration, and docs.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thermo-nuclear reviewScope: head 4c68ec9 against the Fix in this review:
Left as-is, with reasons:
No UI-visible change comes from the fixes. |
Thermo-nuclear review follow-upReviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude. Fixes landed at d16c04d. Fixed:
Left out:
Commands run: |
CUA proofBuild commit: Blocker found while building (PR code, not proof-only): unpatched head fails Proof-only patches (uncommitted, restored afterwards):
Commands:
Screenshots (local, not committed), |
CUA regression follow-upFixes landed at current head b88abef Findings from the CUA proof, all three fixed:
Tests added:
Commands run (Rust 1.98.0, E-core wrappers):
This is a visible UI change: the metered Raycast card gets a new balance line. It needs fresh UI proof on this head. |
UI proof (browser-use)Result: PASS on build At the maintainer's direction, this proof drove the app's WebView2 over CDP with the browser-use CLI (0.1.13) instead of CUA. It used no keyboard, mouse or focus. The proof windows stayed on the second display, and the kit settings turned the global shortcut off so the proof build didn't take Setup
Results
Validation at
|
| Command | Result |
|---|---|
cargo +1.98.0 fmt --all --check |
pass |
cargo +1.98.0 clippy --workspace --all-targets -- -D warnings |
pass |
cargo +1.98.0 test -p codexbar |
2190 passed, 0 failed, 1 ignored |
cargo +1.98.0 test -p codexbar-desktop-tauri |
465 passed, 1 failed: bootstrap_payload_exposes_every_provider_variant, the non-hermetic #684 test that reads the real %APPDATA%\CodexBar\settings.json. #711 fixes it; it is not caused by this PR. |
pnpm install --frozen-lockfile |
pass |
pnpm run check-locale |
882 keys match between Rust and TS |
pnpm test |
67 files, 404 tests passed |
pnpm run lint |
0 errors (unused-import warnings only, the same as on the base) |
pnpm run build |
pass |
Screenshots
All paths are under C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\668\shots\:
bu-01-tray-meter-overview.png: the compact overview, Credits 75% used.bu-02-tray-meter-selected.png: the Raycast card with Pro, 75% used, Resets in 17d 2h and 125 / 500 credits left.bu-03-settings-providers.png: Settings → Providers → Raycast, dark theme.bu-04-tray-nototal-selected.png: 12.5 credits left, with no/ 0.bu-05-tray-expired-selected.png: the session-expired error state.
Not blocking (found on main, not caused by this PR)
- Detail rows render twice in the expanded tray card.
MenuCardDetails.tsxonmainhas two identicalmenu-card__provider-detailssections: one guarded by!compactOverviewand one unguarded, which a merge resolution in [0.61.0] Expose Antigravity terminal strategy outcomes #574 re-added. SodisplayDetailsrows show twice in the expanded card (theLeft/Totalrows innototalhere). The fix is tracked with the 0.62.0 Compact Overview parity port (upstream Add compact Overview layouts steipete/CodexBar#2616, branchport/micro-0.62.0-compact-overview-parity), so this PR leaves it alone. - "1 minutes ago". The
MinutesAgo/UpdatedMinutesAgostrings inen-US.ftlhave no singular form. This is the same onmain. - The Settings usage bar is labelled "Session". The settings
UsageSectionalways usesProviderSessionLabelfor the primary window and ignoresprimaryLabel("Credits" in the tray). This is generic behavior onmainfor every provider.
Summary
Adds the Raycast AI credits provider (upstream CodexBar 0.67.0). It reads monthly credits from the signed-in
www.raycast.comsession and shows credits left, plan, and renewal date.Upstream reference
frontend_api/current_user/ai_credits.Ported
ProviderId::Raycast(raycast, aliasraycast-ai, cookie domainwww.raycast.com, brand#FF6363), factory arm, no-token-account entry.rust/src/providers/raycast/: request (Cookie,Accept,Origin,Referer, ChromeUser-Agent), parse rules (numeric or numeric-string amounts; negative/invalid amounts, bad dates, non-object funding_subscription are parse failures), cookie filtering (only__raycast_sessionandcsrf_token, exact host first), classified errors (missing/expired session, 403, 429, 5xx).Deferred / caveats
credits/detailsare not fetched.toFixed.Validation
cargo fmt --all: clean.cargo clippy --workspace --all-targets -- -D warnings: pass.cargo test -p codexbar raycast: 29 passed.cargo test -p codexbar(full): 2189 passed, 0 failed, 1 ignored.cargo test -p codexbar-desktop-tauri: 464 passed, 1 failed (commands::tests::bootstrap_payload_exposes_every_provider_variant: catalog 80 vs 79 active). That test callsget_bootstrap_state(), which loads this machine's real settings, so a deprecated provider that is enabled locally adds one catalog entry. It is environment-dependent and unrelated to the Raycast change; the three new Raycast shell tests pass.pnpm test(vitest): 67 files, 402 tests passed.pnpm run build: pass.Affected areas
Shared:
ProviderId, provider factory, token accounts,providers/mod.rs(newbrowser_cookies_from_browserhelper). Shell: cookie-source options. Frontend: icon registry, tray dashboard set, settings source hint.UI proof
Pending: coordinator will capture CUA proof on a fresh build. This PR is a draft for that reason.