Conversation
📝 WalkthroughTip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limits.
🔭 Outside diff range comments (3)
apps/desktop/src/components/settings/components/ai/llm-custom-view.tsx (2)
201-208: Avoid watch-in-deps; switch to useWatch to prevent subscription thrash and re-render loopsCalling
customForm.watch("...")in a dependency array creates implicit subscriptions on every render and can cascade into excessive effect executions. Replace withuseWatch, which provides stable values and predictable updates.Apply this diff:
- // Watch for form changes - useEffect(() => { - const apiBase = customForm.watch("api_base"); - const apiKey = customForm.watch("api_key"); - - updateDebouncedValues(apiBase || "", apiKey || ""); - }, [customForm.watch("api_base"), customForm.watch("api_key"), updateDebouncedValues]); + // Watch for form changes (debounced) + const apiBase = useWatch({ control: customForm.control, name: "api_base" }); + const apiKey = useWatch({ control: customForm.control, name: "api_key" }); + useEffect(() => { + updateDebouncedValues(apiBase || "", apiKey || ""); + }, [apiBase, apiKey, updateDebouncedValues]);Add this import at the top of the file:
import { useWatch } from "react-hook-form";
476-486: React SVG prop name typo: use fillRule (camelCase), not fill-ruleIn TSX, SVG attributes use camelCase.
fill-rulewill trigger a type error and may not behave as expected.Apply this diff:
- fill-rule="evenodd" + fillRule="evenodd"apps/desktop/src/components/settings/views/ai-llm.tsx (1)
363-387: Effect reads customLLMEnabled.data but doesn’t subscribe to itThe guard “Don’t open accordion if custom LLM is disabled” won’t re-run when
customLLMEnabled.datachanges, potentially leaving an accordion open while disabled. Add it to the deps array.Apply this diff:
- }, [providerSourceQuery.data, hyprCloudEnabled.data, setOpenAccordion]); + }, [providerSourceQuery.data, hyprCloudEnabled.data, customLLMEnabled.data, setOpenAccordion]);
🧹 Nitpick comments (2)
apps/desktop/src/components/settings/components/ai/llm-custom-view.tsx (2)
137-143: Strengthen HyprCloud exclusion for “others”Equality check misses variants like trailing paths or
/v1. PreferstartsWithto reliably guard against persisting HyprCloud as “others”.Apply this diff:
- (userOpenedAccordion === "others" || customLLMEnabled.data) - && values.api_base && values.api_base !== "https://pro.hyprnote.com" && values.model + (userOpenedAccordion === "others" || customLLMEnabled.data) + && values.api_base && !values.api_base.startsWith("https://pro.hyprnote.com") && values.model
142-143: Silence debug logs in productionKeep noisy logs out of production builds. Gate them to dev.
Apply these diffs:
- console.log("we are now setting the 'others' endpoint"); + if (import.meta.env.DEV) console.log("Setting 'others' endpoint");- console.log("onquery"); - console.log(url.toString()); + if (import.meta.env.DEV) { + console.log("[others-direct-models] onQuery", url.toString()); + }Also applies to: 218-220
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
apps/desktop/src/components/settings/components/ai/llm-custom-view.tsx(14 hunks)apps/desktop/src/components/settings/views/ai-llm.tsx(6 hunks)apps/desktop/src/locales/en/messages.po(19 hunks)apps/desktop/src/locales/ko/messages.po(19 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}
⚙️ CodeRabbit Configuration File
**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".
Files:
apps/desktop/src/components/settings/components/ai/llm-custom-view.tsxapps/desktop/src/components/settings/views/ai-llm.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: cubic · AI code reviewer
- GitHub Check: ci (windows, windows-latest)
- GitHub Check: ci (macos, macos-latest)
🔇 Additional comments (7)
apps/desktop/src/locales/en/messages.po (2)
1170-1173: New gating copy reads well and aligns with UI behaviorThe added string for autonomy gating matches the new disabled state behavior in ai-llm.tsx. No issues.
774-777: Helpful instruction for API Base URLThe additional description for the custom endpoint base URL improves clarity. Consistent with validation rules in ai-llm.tsx.
apps/desktop/src/components/settings/components/ai/llm-custom-view.tsx (1)
65-67: User-intent gating for auto-config is a solid UX improvementTracking which accordion the user opened prevents unintended provider switches. This fixes accidental auto-configuration reported earlier.
apps/desktop/src/locales/ko/messages.po (1)
1170-1173: Missing translations for newly introduced/relocated keysSeveral new keys have empty msgstr (e.g., autonomy gating, provider labels, OpenRouter copy). If shipping now, Lingui will fall back to English. Confirm this is acceptable for this hotfix; otherwise, add Korean strings before merge.
Would you like me to supply Korean translations for the new keys to avoid fallback?
Also applies to: 259-262, 327-330, 851-854, 1213-1216, 1360-1362, 992-995
apps/desktop/src/components/settings/views/ai-llm.tsx (3)
391-409: Default-to-“others” fallback is consistent and avoids persisting HyprCloud URLOpening “others” when custom is enabled and nothing is set, plus clearing the HyprCloud URL from others, matches the new gating and avoids misconfiguration. Looks good.
528-537: Prevent leaking HyprCloud URL into “others” formSkipping setting
api_basewhen it equals the HyprCloud URL is correct and aligns with the custom-view logic.
681-776: Autonomy UI gating and disabled styling are coherentThe selector now always renders but is clearly disabled until a Custom Endpoint is configured, with precise helper text. Behavior and analytics calls are gated correctly by the disabled state.
Summary by cubic
Fixes unintended switching between HyprCloud and Custom endpoints and makes custom setup explicit and user-driven. Also prevents the HyprCloud URL from being saved as a Custom endpoint and clarifies when the Autonomy Selector is usable.
Bug Fixes
UI Improvements