Skip to content
Closed
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: 3 additions & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,9 @@ export class ClineProvider
requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId,
}

await this.upsertProviderProfile(currentApiConfigName, newConfiguration)
// Create a new profile with a unique name to trigger settings refresh
Copy link
Contributor

Choose a reason for hiding this comment

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

Inconsistency with other OAuth providers: I notice that OpenRouter (line 1383) and Glama (line 1413) OAuth callbacks update the existing profile, while Requesty creates a new one. Is this intentional? This inconsistency could confuse users who expect similar behavior across providers. Could you explain why Requesty needs different behavior?

const newProfileName = currentApiConfigName === "default" ? "requesty-oauth" : currentApiConfigName
Copy link
Contributor

Choose a reason for hiding this comment

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

Critical Issue: This could cause a profile name collision. What happens if a profile named "requesty-oauth" already exists? Consider checking for existing profiles or generating a unique name:

Suggested change
const newProfileName = currentApiConfigName === "default" ? "requesty-oauth" : currentApiConfigName
// Create a new profile with a unique name to trigger settings refresh
let newProfileName = currentApiConfigName === "default" ? "requesty-oauth" : currentApiConfigName
// Ensure the profile name is unique
if (this.hasProviderProfileEntry(newProfileName)) {
newProfileName = `requesty-oauth-${Date.now()}`
}
await this.upsertProviderProfile(newProfileName, newConfiguration)

await this.upsertProviderProfile(newProfileName, newConfiguration)
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing error handling: Unlike the OpenRouter and Glama callbacks which have try-catch blocks for API calls, this method doesn't validate the code parameter or handle potential errors. Consider adding validation at the start of the method.

}

// Task history
Expand Down
Loading