Skip to content

Conversation

@mstfash
Copy link
Collaborator

@mstfash mstfash commented Jan 29, 2026

Summary

This PR improves the robustness of billing data deserialization and refactors how local LLM providers are detected and displayed in the TUI. It ensures the CLI handles optional billing fields gracefully and correctly identifies "Local" or "BYOM" (Bring Your Own Model) configurations in the UI.

Key Changes

  • Billing Models (libs/shared):
    • Added #[serde(default)] to BillingResponse, Product, and ProductItem fields.
    • Made Product.items optional (Option<Vec<ProductItem>>) to prevent deserialization errors when the API returns incomplete data (e.g., during plan changes).
  • Configuration (cli):
    • Refactored AppConfig::is_using_local_provider and get_auth_display_info to correctly detect if a local provider (OpenAI, Anthropic, Gemini) is configured via auth.toml or config.toml, even if the main profile is set to Remote.
    • Refactor: Simplifed conditional logic in app.rs using is_some_and (addressing valid clippy warnings).
  • TUI (tui):
    • Side Panel: Added text wrapping to the "Todos" section in the side panel to prevent truncation of long items.
    • Footer: Updated the status footer to properly reflect "Local" or "BYOM" auth states based on the improved detection logic.

Impact

  • Prevents CLI crashes when the Billing API response format varies.
  • Provides accurate visual feedback in the TUI when users are using their own API keys or local endpoints.

@mstfash mstfash marked this pull request as ready for review January 29, 2026 16:21
@mstfash mstfash marked this pull request as draft January 30, 2026 12:39
@mstfash mstfash changed the title Fix/remaining balance Fix/remaining balance [PARKED - WILL HAVE DEPRECATION] Jan 30, 2026
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.

2 participants