Files
fusion/packages
flexi767 f49f5eb39a fix(dashboard): report Claude CLI login and API billing states (#2338)
## What changed

- Detect the Claude CLI `Not logged in · Run /login` screen and return
an actionable error immediately.
- Detect Claude 2.1.x `API Usage Billing` session-stat output, which has
no subscription quota windows, instead of waiting for the PTY timeout.
- Keep the existing quota-window parser unchanged for authenticated
subscription sessions.

## Root cause and impact

Fusion only recognized the older `/usage` quota view. Newer Claude CLI
builds can render a login prompt or API-billing session statistics after
accepting `/usage`; neither contains quota windows, so Fusion waited 60
seconds and reported a misleading timeout even though it had already
received conclusive output.

Operators now get an immediate instruction to run `claude /login` on the
Fusion host.

## Validation

- `vitest run src/__tests__/usage.test.ts`: 196 passed
- Dashboard TypeScript typecheck passed
- Changeset format check passed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Claude usage detection now recognizes authentication-required states
and stops immediately instead of waiting and reporting a misleading
“usage timeout.”
* Enhanced parsing/fallback behavior for Claude “usage” and
billing/session statistics screens, improving reliability when
subscription quota data isn’t available.
* **Tests**
* Added coverage for Claude CLI fallback scenarios after HTTP 429
responses, including validation of correct error messaging and process
termination behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: v <v@v.speedport.ip>
Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
2026-07-21 16:54:28 -07:00
..
2026-07-21 01:00:46 -07:00
2026-07-21 01:00:46 -07:00
2026-07-21 01:00:46 -07:00
2026-07-21 01:00:46 -07:00
2026-07-21 01:00:46 -07:00