Add Atlas Cloud API bots - #1082
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds Atlas Cloud API support with two model bots, Vuex configuration, settings UI integration, default chat entries, bot registration, and localized provider/model labels. ChangesAtlas Cloud integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant AtlasCloudAPIBotSettings
participant VuexStore
participant AtlasCloudAPIBot
participant ChatOpenAI
User->>AtlasCloudAPIBotSettings: Enter API key and model settings
AtlasCloudAPIBotSettings->>VuexStore: Commit setAtlasCloudApi
AtlasCloudAPIBotSettings->>AtlasCloudAPIBot: Call setupModel()
AtlasCloudAPIBot->>VuexStore: Read Atlas Cloud configuration
AtlasCloudAPIBot->>ChatOpenAI: Create streaming Atlas Cloud client
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces the Atlas Cloud API bot integration, adding support for the Qwen 3.5 Flash and DeepSeek V4 Pro models. It includes the core bot implementation, settings UI, store updates, and localization files. Feedback on the changes highlights a critical configuration issue where baseURL should be used instead of basePath for the LangChain OpenAI SDK, and a bug where 0 is incorrectly treated as falsy for pastRounds. Additionally, improvements are suggested to use .forEach() instead of .map() for side effects, and to clean up the template formatting in the settings component.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| _setupModel() { | ||
| const chatModel = new ChatOpenAI({ | ||
| configuration: { | ||
| basePath: "https://api.atlascloud.ai/v1", | ||
| }, |
There was a problem hiding this comment.
In @langchain/openai (which uses the openai SDK v4), the custom API endpoint should be configured using the baseURL parameter instead of basePath. Using basePath will cause the SDK to ignore the custom endpoint and default to the official OpenAI API URL (https://api.openai.com/v1), which will fail for Atlas Cloud.
| _setupModel() { | |
| const chatModel = new ChatOpenAI({ | |
| configuration: { | |
| basePath: "https://api.atlascloud.ai/v1", | |
| }, | |
| _setupModel() { | |
| const chatModel = new ChatOpenAI({ | |
| configuration: { | |
| baseURL: "https://api.atlascloud.ai/v1", | |
| }, |
| getPastRounds() { | ||
| return store.state.atlasCloudApi.pastRounds | ||
| ? store.state.atlasCloudApi.pastRounds | ||
| : 5; | ||
| } |
There was a problem hiding this comment.
Using a simple ternary check store.state.atlasCloudApi.pastRounds ? ... will treat 0 as a falsy value. Since 0 is a valid configuration value for pastRounds (allowing users to disable chat history), this check will incorrectly fall back to the default value of 5. Use the nullish coalescing operator (??) to correctly handle 0.
getPastRounds() {
return store.state.atlasCloudApi.pastRounds ?? 5;
}| watcher() { | ||
| _bots.all | ||
| .filter((bot) => bot instanceof Bot) | ||
| .map((bot) => bot.setupModel()); | ||
| }, |
There was a problem hiding this comment.
Using .map() solely for side effects (calling bot.setupModel()) is an anti-pattern because .map() is intended to construct and return a new array. Use .forEach() instead to clearly signal that this operation is performed for its side effects.
watcher() {
_bots.all
.filter((bot) => bot instanceof Bot)
.forEach((bot) => bot.setupModel());
},
| <template> | ||
| <CommonBotSettings | ||
| :settings="settings" | ||
| :brand-id="brandId" | ||
| mutation-type="setAtlasCloudApi" | ||
| :watcher="watcher" | ||
| ></CommonBotSettings | ||
| > | ||
| </template> |
There was a problem hiding this comment.
The template has inconsistent indentation and a split closing tag ></CommonBotSettings\n >. Clean up the formatting and use a self-closing tag for better readability and consistency with Vue style guidelines.
<template>
<CommonBotSettings
:settings="settings"
:brand-id="brandId"
mutation-type="setAtlasCloudApi"
:watcher="watcher"
/>
</template>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/components/BotSettings/AtlasCloudAPIBotSettings.vue (1)
68-72: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse
.forEach()instead of.map()for side effects.The
.map()method is intended for transforming arrays. Since the resulting array is unused and the goal is simply to triggersetupModel()on each bot as a side effect, use.forEach()instead. As per coding guidelines, this also prevents potential ESLint warnings for unused array returns.♻️ Proposed refactor
watcher() { _bots.all .filter((bot) => bot instanceof Bot) - .map((bot) => bot.setupModel()); + .forEach((bot) => bot.setupModel()); },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/BotSettings/AtlasCloudAPIBotSettings.vue` around lines 68 - 72, Update the watcher() method to replace the unused .map() call with .forEach() when invoking bot.setupModel() on filtered Bot instances, preserving the existing filtering and side-effect behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/bots/atlascloud/AtlasCloudAPIBot.js`:
- Around line 38-42: Update AtlasCloudAPIBot.getPastRounds() to use a nullish
check for store.state.atlasCloudApi.pastRounds, preserving an intentional value
of 0 while still defaulting to 5 when the value is null or undefined.
- Around line 25-34: Update the ChatOpenAI configuration in the constructor to
use the baseURL property instead of basePath, preserving the existing AtlasCloud
endpoint value so the client targets the correct API.
---
Nitpick comments:
In `@src/components/BotSettings/AtlasCloudAPIBotSettings.vue`:
- Around line 68-72: Update the watcher() method to replace the unused .map()
call with .forEach() when invoking bot.setupModel() on filtered Bot instances,
preserving the existing filtering and side-effect behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d206b7b7-f98e-4b0e-a6f7-e333adbba7b5
📒 Files selected for processing (19)
src/bots/atlascloud/AtlasCloudAPIBot.jssrc/bots/atlascloud/AtlasCloudDeepSeekV4ProBot.jssrc/bots/atlascloud/AtlasCloudQwen35FlashBot.jssrc/bots/index.jssrc/components/BotSettings/AtlasCloudAPIBotSettings.vuesrc/components/SettingsModal.vuesrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/ko.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/vi.jsonsrc/i18n/locales/zh.jsonsrc/i18n/locales/zhtw.jsonsrc/store/chats.jssrc/store/index.js
Summary
Validation
npm ci --ignore-scriptscould not run because the current package-lock is out of sync with package.json.npm run buildalso fails in this local install with Webpacknode:scheme errors from resolved dependencies, so I kept validation focused on the changed source and JSON files.No README changes. No sponsor, logo, credits, or partner placement.
Summary by CodeRabbit