-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add TARS (Tetrate Agent Router Service) as a native provider #6748
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
Conversation
- Add TARS provider types and constants - Implement TarsHandler for API integration - Create TARS UI component for settings - Add TARS to provider registrations - Include comprehensive tests for TARS provider Closes #6747
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.
Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.
| placeholder={t("settings:placeholders.apiKey")} | ||
| className="w-full"> | ||
| <div className="flex justify-between items-center mb-1"> | ||
| <label className="block font-medium">{t("settings:providers.tarsApiKey")}</label> |
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.
Missing i18n translations - these translation keys don't exist in any locale files:
settings:providers.tarsApiKeysettings:providers.tarsDescriptionsettings:providers.tarsModelDescription
This will cause the UI to display the translation keys instead of proper text. Could we add these translations to all locale files?
|
|
||
| override getModel() { | ||
| const id = this.options.tarsModelId ?? tarsDefaultModelId | ||
| const info = tarsDefaultModelInfo |
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.
Is this intentional? The getModel() method always returns tarsDefaultModelInfo regardless of the selected model ID. Since TARS is a router service like OpenRouter, shouldn't it fetch and return the actual model information for the selected model?
| const info = tarsDefaultModelInfo | |
| override getModel() { | |
| const id = this.options.tarsModelId ?? tarsDefaultModelId | |
| // TODO: Fetch actual model info from TARS API based on model ID | |
| // For now, return default info but this should be improved | |
| const info = tarsDefaultModelInfo | |
| return { id, info } | |
| } |
| inputTokens: lastUsage.prompt_tokens || 0, | ||
| outputTokens: lastUsage.completion_tokens || 0, | ||
| cacheReadTokens: lastUsage.prompt_tokens_details?.cached_tokens, | ||
| totalCost: 0, // TARS doesn't provide cost information in the API response |
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.
The cost is always returned as 0. Since TARS is a router service, could we extract cost information from the API response if available? This would help users track their usage costs.
| totalCost: 0, // TARS doesn't provide cost information in the API response | |
| totalCost: 0, // TODO: Extract cost from TARS API response if available |
| </div> | ||
| <div className="text-sm text-vscode-descriptionForeground">{t("settings:providers.tarsDescription")}</div> | ||
| <VSCodeTextField | ||
| value={apiConfiguration?.tarsModelId || tarsDefaultModelId} |
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.
Unlike OpenRouter, this implementation doesn't provide a way to discover available models dynamically. Users would need to know model IDs in advance. Could we consider adding a model picker similar to OpenRouter's implementation?
| super() | ||
| this.options = options | ||
|
|
||
| const baseURL = this.options.tarsBaseUrl || "https://api.tetrate.io/v1" |
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.
Consider adding validation for the base URL, especially when users provide a custom tarsBaseUrl. We could validate it's a proper URL format before using it.
|
I don't think this is correct, closing for now |
This PR adds TARS (Tetrate Agent Router Service) as a native provider option in Roo Code, eliminating the need for manual configuration as an OpenAI-compatible provider.
Changes
packages/typesTarsHandlerfor API integration following OpenRouter patternuseSelectedModelhook to handle TARS providerBenefits
Testing
Closes #6747
Important
Adds TARS as a native provider with API integration, UI components, and comprehensive tests.
provider-settings.ts,index.ts, andtars.ts.TarsHandlerintars.tsfor API integration, following OpenRouter pattern.buildApiHandlerinindex.tsto include TARS.ApiOptions.tsxandTars.tsx.useSelectedModelhook to handle TARS provider.TarsHandlerintars.spec.ts.constants.tsandproviders/index.tsto include TARS.This description was created by
for c52d3d4. You can customize this summary. It will automatically update as commits are pushed.