Skip to content

Conversation

@xavieroyj
Copy link

@xavieroyj xavieroyj commented Jan 26, 2026

Related GitHub Issue

Closes: #10970

Roo Code Task Context (Optional)

Description

Test Procedure

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

Documentation Updates

Additional Notes

Get in Touch

- Add 'firmware' to dynamicProviders array
- Create firmwareSchema with firmwareApiKey and firmwareModelId
- Add firmware to providerSettingsSchemaDiscriminated union
- Add firmwareModelId to modelIdKeys
- Add firmware to modelIdKeysByProvider mapping
- Add firmware entry to MODELS_BY_PROVIDER
- Add FirmwareHandler extending RouterProvider for OpenAI-compatible API
- Add firmware fetcher for models and quota endpoints
- Update modelCache to include firmware provider case
- Export FirmwareHandler from providers index
- Add firmware case in buildApiHandler switch
- Add firmware to dynamicProviderExtras for model management
- Add firmware case in useSelectedModel hook
- Fix test mock to include firmware in RouterModels
- Test constructor with various options configurations
- Test getModel with valid and unknown model IDs
- Test fetchModel API call with correct parameters
- Test createMessage streaming responses
- Test completePrompt non-streaming completion
- Test processUsageMetrics with and without cache data
- Test getFirmwareModels and getFirmwareQuota fetchers
- Add firmwareQuota and requestFirmwareQuota message types
- Create useFirmwareQuota hook for fetching quota info
- Create FirmwareQuotaDisplay component showing remaining balance
- Create Firmware settings component with API key, model picker, and quota
- Add firmwareModelId to ModelPicker's ModelIdKey type
- Export Firmware component from providers index
- Import getFirmwareQuota from firmware fetcher
- Add firmware to routerModels initialization object
- Add firmware to candidates array for model fetching
- Add requestFirmwareQuota message handler to fetch quota info
- Import Firmware component
- Add firmware to PROVIDER_MODEL_CONFIG mapping
- Add Firmware component render when selected
- Add firmware to PROVIDERS array in constants
- Add firmwareApiKey to model refresh debounce dependencies
The Firmware.ai /api/v1/quota endpoint returns:
- used: Amount used in current window (0 to 1 scale, 1 = limit reached)
- reset: ISO timestamp when quota resets

Updated:
- getFirmwareQuota fetcher to return {used, reset}
- Message handler to send used/reset fields
- useFirmwareQuota hook interface
- FirmwareQuotaDisplay to show percentage and time until reset
- Tests for new response format

Display now shows:
- Normal: '52% used · resets in 2h 30m'
- Warning (>80%): yellow styling
- At limit (100%): 'Limit reached · resets in Xm' with red styling
Changed from Math.round() to toFixed(2) for more precise display:
- 0.0004 → '0.04% used' (instead of '0% used')
- 0.5217 → '52.17% used' (instead of '52% used')

Also removed unused VSCodeLink import from Firmware.tsx
- Add firmwareApiKey to SECRET_STATE_KEYS array
- Ensures checkExistKey() recognizes firmware provider as configured
- Fixes issue where onboarding wouldn't complete after entering API key
- Add test case for firmware provider validation
- Update default model to anthropic/claude-sonnet-4-5-20250929
- Improve UI: move quota display above API key field
- Update service URL to docs.firmware.ai
When quota hasn't been used yet, the API returns null for reset since
the 5-hour rolling window hasn't started. Now only shows reset time
when it's available, displaying just 'X% used' otherwise.
@xavieroyj xavieroyj requested review from cte, jr and mrubens as code owners January 26, 2026 12:41
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Enhancement New feature or request labels Jan 26, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 26, 2026

Rooviewer Clock   See task on Roo Cloud

Roo Code Review

All previously flagged issues have been resolved. The PR is ready for merge.

TODO

  • 20525d67a9 Test expects wrong default model ID - Resolved
  • 5f0097e467 Indentation inconsistency in src/api/providers/__tests__/firmware.spec.ts lines 74-80 - Resolved
Previous reviews

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

Copy link
Contributor

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is well-structured and follows the established RouterProvider pattern correctly. The Firmware.ai integration includes proper model fetching, quota display, and type definitions.

One minor fix required: The test in src/api/providers/__tests__/firmware.spec.ts expects the wrong default model ID. Please apply the suggested fix to update the expected value from "claude-sonnet-4-5" to "anthropic/claude-sonnet-4-5-20250929" before merging.

Otherwise, great work on this provider integration!

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
xavieroyj and others added 2 commits January 26, 2026 22:49
- Add firmware provider to router model expectations in ClineProvider.spec.ts (3 tests)
- Add firmware provider to router model expectations in webviewMessageHandler.spec.ts (4 tests)
- Update mock call sequences to include firmware provider (placed after chutes, before litellm)

All tests now pass (5161 passed). The firmware provider was recently added to the
dynamic providers list and these tests needed to be updated to include it in their
expected routerModels objects.
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Add FirmwareAI as Provider

1 participant