Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/shared/checkExistApiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export function checkExistKey(config: ProviderSettings | undefined) {
return false
}

// Special case for human-relay, fake-ai, and claude-code providers which don't need any configuration.
if (config.apiProvider && ["human-relay", "fake-ai", "claude-code"].includes(config.apiProvider)) {
// Special case for human-relay, fake-ai, claude-code, and roo providers which don't need any configuration.
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment could be more specific about why these providers are special. Perhaps something like: "Special case for providers that use alternative authentication methods (session tokens, relay, etc.) instead of API keys"?

if (config.apiProvider && ["human-relay", "fake-ai", "claude-code", "roo"].includes(config.apiProvider)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be helpful to add test coverage for these special case providers? I noticed the test file doesn't include any tests verifying that 'roo' (and the other special providers) return true without requiring configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider extracting this array as a constant like NO_CONFIG_REQUIRED_PROVIDERS to improve maintainability. This would make it easier to find all providers that don't require configuration and could be reused if needed elsewhere:

Suggested change
if (config.apiProvider && ["human-relay", "fake-ai", "claude-code", "roo"].includes(config.apiProvider)) {
const NO_CONFIG_REQUIRED_PROVIDERS = ["human-relay", "fake-ai", "claude-code", "roo"]
// Special case for providers that use alternative authentication methods instead of API keys.
if (config.apiProvider && NO_CONFIG_REQUIRED_PROVIDERS.includes(config.apiProvider)) {

return true
}

Expand Down
Loading