-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature/add firmware.ai provider #10972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/add firmware.ai provider #10972
Conversation
- 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.
Roo Code ReviewAll previously flagged issues have been resolved. The PR is ready for merge. TODO
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
There was a problem hiding this 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>
- 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>
Related GitHub Issue
Closes: #10970
Roo Code Task Context (Optional)
Description
Test Procedure
Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch