Add BYOK custom AI provider support for Ask AI#8606
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fbfb523fd5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Implemented the Codex review feedback in
Verified with: npm test -- --runInBand --watchAll=false src/Utils/GDevelopServices/Generation.spec.js src/MainFrame/Preferences/AiProvidersPreferences.spec.js src/EditorFunctions/EditorFunctions.spec.js |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef141c3ac9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Implemented the remaining Codex review feedback in
Verified with: npm test -- --runInBand --watchAll=false src/Utils/GDevelopServices/Generation.spec.js
npm test -- --runInBand --watchAll=false src/EditorFunctions/EditorFunctions.spec.js
npx eslint src/AiGeneration/UseGenerateEvents.js src/Utils/GDevelopServices/Generation.js src/Utils/GDevelopServices/Generation.spec.js --max-warnings=0
npm run flow |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 079406ee00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Implemented the latest Codex review feedback in
Verified with: npm test -- --runInBand --watchAll=false src/Utils/GDevelopServices/Generation.spec.js src/MainFrame/Preferences/AiProvidersPreferences.spec.js src/AiGeneration/Utils.spec.js
npx eslint src/Utils/GDevelopServices/Generation.js src/Utils/GDevelopServices/Generation.spec.js src/MainFrame/Preferences/AiProvidersPreferences.js src/MainFrame/Preferences/AiProvidersPreferences.spec.js src/AiGeneration/AskAiEditorContainer.js src/AiGeneration/AskAiStandAloneForm.js src/AiGeneration/Utils.js --max-warnings=0
npm run flow |

Summary
This PR adds bring-your-own-key support to Ask AI, so users can configure an OpenAI-compatible provider and use whichever model they want instead of being limited to the default GDevelop AI provider.
The feature adds:
The main goal is BYOK: let people plug in their own provider/API key/model and keep using the Ask AI workflow. The rest of the changes serve that path: preserving configuration across request refreshes, handling provider availability errors, avoiding uploads for local providers, and keeping the UI honest about who may bill the request.
Testing
I ran the focused test set:
npm test -- --runInBand --watchAll=false src/AiGeneration/AiProviderConfigurations.spec.js src/AiGeneration/AiRequestChat/AiConfigurationPresetSelector.spec.js src/MainFrame/Preferences/AiProvidersPreferences.spec.js src/AiGeneration/Utils.spec.js src/Utils/GDevelopServices/Generation.spec.js src/EditorFunctions/EditorFunctions.spec.jsThis passed with 6 suites and 101 tests.
I’ve also tested the feature manually, and everything seems to work with no regressions I was able to notice.