Skip to content

Conversation

@Thibault00
Copy link
Contributor

@Thibault00 Thibault00 commented Oct 17, 2025

Fixing requesty oauth flow


Important

Fixes Requesty OAuth flow by creating a new profile with a fixed name and default model ID in ClineProvider.ts.

  • Behavior:
    • In ClineProvider.ts, handleRequestyCallback() now creates a new Requesty profile with a fixed name "Requesty" and default model ID requestyDefaultModelId.
    • Removes usage of apiConfiguration and currentApiConfigName from getState() in handleRequestyCallback().
  • Misc:
    • Simplifies the Requesty OAuth flow by directly setting the profile name and model ID.

This description was created by Ellipsis for a97ecd9e887c257e3ed5560524bb5dfc4b3b87f3. You can customize this summary. It will automatically update as commits are pushed.

@Thibault00 Thibault00 requested review from cte, jr and mrubens as code owners October 17, 2025 10:53
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Oct 17, 2025
@roomote
Copy link
Contributor

roomote bot commented Oct 17, 2025

Review Summary

Issues Found: 0

Issues to Address:

  • Preserve base provider settings when creating Requesty profile (diffEnabled, fuzzyMatchThreshold, rateLimitSeconds, etc.)
  • Preserve existing Requesty model ID when re-authenticating instead of always overwriting with default
  • Fix requestyBaseUrl inheritance issue when OAuth callback returns default URL or null

Review completed by Roo Code PR Review

View Job

@dosubot dosubot bot added the bug Something isn't working label Oct 17, 2025
Comment on lines 1460 to 1467
const newConfiguration: ProviderSettings = {
...apiConfiguration,
apiProvider: "requesty",
requestyApiKey: code,
requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId,
requestyModelId: requestyDefaultModelId,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This implementation creates a Requesty profile without preserving base provider settings (like diffEnabled, fuzzyMatchThreshold, rateLimitSeconds, consecutiveMistakeLimit, etc.) that users may have customized. Unlike the OpenRouter (line 1414) and Glama (line 1447) handlers which spread apiConfiguration to preserve these settings, this creates a minimal configuration with only Requesty-specific fields. Consider preserving user preferences: { ...apiConfiguration, apiProvider: "requesty", requestyApiKey: code, requestyModelId: requestyDefaultModelId }

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Thibault00 what do you think of this? Would it cause any issues to preserve the apiConfiguration like the others?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch! We leave the spread in place now

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 17, 2025
apiProvider: "requesty",
requestyApiKey: code,
requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId,
requestyModelId: requestyDefaultModelId,
Copy link
Contributor

Choose a reason for hiding this comment

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

The removal of the conditional fallback apiConfiguration?.requestyModelId || requestyDefaultModelId means users will lose their custom model selection when re-authenticating with Requesty. Both OpenRouter (line 1418) and Glama (line 1451) handlers preserve the existing model ID if set. Consider restoring: requestyModelId: apiConfiguration?.requestyModelId || requestyDefaultModelId to maintain consistency and preserve user preferences.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 20, 2025
@requesty-JohnCosta27
Copy link
Contributor

@mrubens I've made some changes to this PR but I have a question/observation I had whilst developing it:

When Requesty.tsx is loading inside SettingsView, and you change the base URL, and processed with the OAuth flow, when you come back a few things happen:

  1. The useEffect I added in this PR means the user sees a change in their settings, which they didn't seem to do before (but it is possible I missed something here).
  2. The unsaved base URL is removed, but the user has actually created an API key agains't that custom URL, so now if they save they won't be able to use the key.

A work around for now is to save the custom base url first, and only then go through the OAuth flow, this works.

But it makes me thing that maybe I'm missing a mechanism which updates the UI after an OAuth request. Something that updates the cachedSettings inside SettingsView. I don't think this exists, or if it's something you guys would like to add, but I would find it really useful.

If not, what do you think would be a good approach for this problem?

@requesty-ditti
Copy link

@mrubens, are you happy with the fix proposed here?
(As John mentioned, not an ideal one for users with a custom base URL, but at least the OAuth flow works for 80% of the users)

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Oct 23, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 24, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Oct 24, 2025
@requesty-JohnCosta27
Copy link
Contributor

@roomote can you translate from english to other languages? I didn't see your last change (or maybe i override it?)

@roomote
Copy link
Contributor

roomote bot commented Oct 25, 2025

Thanks for the ping. Yes, I can translate the new English strings. I previously added translations across locales, but the latest commits may have overridden them. I will 1) re-scan the changed English keys in this PR, 2) propagate them to all supported locales (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW), 3) run the i18n checks, and 4) push an update to this branch shortly. If you need additional locales, let me know which ones and I will include them.

@roomote
Copy link
Contributor

roomote bot commented Oct 25, 2025

Translations added and verified.

Summary:

  • Updated key settings.providers.getRequestyApiKey across 17 locales to match the new English copy "Create new Requesty API Key".
  • UI references confirmed in Requesty.tsx and Requesty.tsx.
  • English base updated at en/settings.json.
  • French wording aligned at fr/settings.json; analogous updates applied across all locales.

Verification:

  • Missing translations script: scripts/find-missing-translations.js reports all translations complete.
  • Webview unit tests: vitest passed for all tests.
  • CI checks: check-translations and the full workflow are green.
  • Commit: bddaa02 (i18n(requesty): translate Create new Requesty API Key across locales)

If you prefer alternative wording for any locale, specify the locale and desired phrase and I will adjust.

@requesty-ditti
Copy link

@mrubens / @daniel-lxs,
Can you please take a second look at this PR?
It is done and dusted, and almost the same as the version you've already approved...

@mrubens mrubens merged commit ca10cba into RooCodeInc:main Nov 2, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Nov 2, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Nov 2, 2025