You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codexbar-cli usage ignores hand-pasted manual cookies; diagnose uses them #1073
On 0.70.0 (Windows 11), codexbar-cli usage -f json reports Cursor as needsAuthentication: No cookies available for web API even though a manual Cookie header for Cursor is saved in the app (Settings > Providers > Cursor > paste Cookie header > Save Cookie; the header is stored in %APPDATA%\CodexBar\manual_cookies.json, confirmed present on disk). codexbar-cli diagnose -p cursor on the same machine, minutes apart, reports auth.configured: true, mode manual_cookie, no error, and real usage data.
Root cause (from source)
rust/src/cli/diagnose.rs (collect_provider_diagnostic) builds its FetchContextwithmanual_cookie_header: manual_cookies.get(provider_id.cli_name())— it loadsManualCookies`.
rust/src/cli/usage.rs (build_usage_fetch_context) builds its FetchContextwith..FetchContext::default()and never setsmanual_cookie_header. The only per-provider credential injection on the usage path is project_cli_account, which covers only Kimi/Doubao/OpenCodeGo token accounts — Cursor is not in that list — and resolve_cli_api_keyonly fillsapi_key`, which Cursor does not use.
So in usage, Cursor's fetch_web_usage skips the manual cookie, tries the Cursor app session, then browser cookies; when both fail it returns the exhaustion error (No cookies available for web API, logged as WARN Cursor API fetch failed: ...).
Repro
Win-CodexBar 0.70.0 on Windows 11. In Settings > Providers > Cursor, paste a Cookie header and click Save Cookie. Verify %APPDATA%\CodexBar\manual_cookies.json exists (mine: 7349 bytes, written when I saved).
codexbar-cli usage -f json --web-timeout 25 → cursor row: {"provider": "cursor", "error": "Cursor API fetch failed: No cookies available for web API", "errorKind": "needsAuthentication"} (stderr also shows the WARN).
codexbar-cli diagnose -p cursor --pretty → cursor: auth.configured: true, modes: ["manual_cookie", "web_supported"], error: null, account_present: true, and real windows (e.g. cursor-grok-bot 61.63% used, weekly window).
Expected
usage should use the saved manual cookie the same way diagnose does, so cookie-based providers work from the CLI without depending on the desktop app's usage cache.
Notes
I know the designed sharing route is Settings > Advanced > Share usage with the CLI (cli-usage-cache.json), but that feature landed in main after 0.70.0 (commit 5f489ad, 2026-10-20) and is not in any release yet, so it cannot work around this on 0.70.0.
Side observation, not the bug itself: on current accounts the Cursor API returns only the cursor-grok-bot extra window with real data; primary/secondary come back as 0% placeholders (no window length, reset 2026-12-01). That is what diagnose shows, so the cookie path itself works — only usage misses it.
Activity