Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 30, 2025

Related GitHub Issue

Closes: #10370

Description

This PR attempts to address Issue #10370 by adding a configurable currency symbol for LiteLLM provider users.

Implementation Details:

  • Added litellmCurrencySymbol field to the LiteLLM provider settings schema
  • Created a getCurrencySymbol() utility function that returns the custom symbol for LiteLLM users or defaults to "$"
  • Added a UI configuration input in the LiteLLM settings panel
  • Updated all cost display components to use the configurable currency symbol:
    • TaskItemFooter (history list)
    • ChatRow (API request costs)
    • BrowserSessionRow (browser session costs)
    • TaskHeader (collapsed and expanded task cost views)
    • CondensationResultRow (context condensation costs)
    • MaxCostInput (auto-approval cost limit input)

The design uses an optional string field that allows any symbol (single or multi-character), defaulting to "$" when not configured. This approach was chosen to minimize risk of impacting existing users while giving LiteLLM users full flexibility.

Test Procedure

  1. Unit Tests:

    • Added comprehensive tests for getCurrencySymbol() utility function (8 test cases)
    • Added tests for MaxCostInput component with custom currency symbols (4 new test cases)
    • All tests pass: cd webview-ui && npx vitest run
  2. Manual Testing:

    • Select LiteLLM as provider
    • Configure a custom currency symbol in the provider settings (e.g., "€", "£", or "Credits")
    • Verify the symbol appears in all cost displays (task header, chat rows, history)
    • Verify non-LiteLLM providers continue showing "$" as before

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

N/A - This is a text-only change. The UI displays the configured currency symbol instead of a hardcoded "$" symbol.

Documentation Updates

  • No documentation updates are required.

The feature is self-explanatory via the UI field label and description.

Additional Notes

Feedback and guidance are welcome! This implementation follows Option 1 from the issue discussion - making the currency symbol user-configurable specifically for LiteLLM users.

Get in Touch

N/A - I am an AI assistant (@roomote)

- Add litellmCurrencySymbol field to provider settings schema
- Create getCurrencySymbol utility function for retrieving the appropriate symbol
- Add UI configuration in LiteLLM settings panel
- Update cost display components to use configurable currency symbol:
  - TaskItemFooter
  - ChatRow
  - BrowserSessionRow
  - TaskHeader
  - CondensationResultRow
  - MaxCostInput
  - MaxLimitInputs
  - AutoApproveSettings
- Add i18n translations for the new setting
- Add comprehensive tests for getCurrencySymbol and MaxCostInput

Closes #10370
@roomote
Copy link
Contributor Author

roomote bot commented Dec 30, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

This PR cleanly implements a configurable currency symbol for LiteLLM provider users. The implementation is well-structured, properly typed, and thoroughly tested.

Changes reviewed:

  • Schema extension for litellmCurrencySymbol field
  • Utility function getCurrencySymbol() with proper edge case handling
  • All cost display components updated consistently
  • Comprehensive test coverage added
  • i18n translations in place

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] configurable currency symbol when LiteLLM integration is used

3 participants