Fixed an issue where AI features are visible in the UI even when LLM_…#9727
Fixed an issue where AI features are visible in the UI even when LLM_…#9727dpage wants to merge 1 commit intopgadmin-org:masterfrom
Conversation
…ENABLED is set to False
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThis pull request implements conditional visibility of AI features in pgAdmin based on the LLM_ENABLED configuration setting. The backend config value is passed to the frontend, exposing an Changes
Sequence Diagram(s)sequenceDiagram
participant Config as Config System
participant PyInit as Python: browser/__init__.py
participant JSUtils as JavaScript: utils.js
participant LLMModule as LLM: llm/__init__.py
participant AITools as JavaScript: ai_tools.js
participant QueryTool as QueryTool Component
Config->>PyInit: LLM_ENABLED setting
PyInit->>JSUtils: Pass llm_enabled to template
JSUtils->>JSUtils: Initialize pgAdmin.llm_enabled flag
alt LLM_ENABLED = False
LLMModule->>LLMModule: Early return from register_preferences()
AITools->>AITools: Skip menu registration in checkLLMStatus()
QueryTool->>QueryTool: Do not include AI Assistant tab
else LLM_ENABLED = True
LLMModule->>LLMModule: Register AI preferences
AITools->>AITools: Call registerMenus() when llmSystemEnabled = true
QueryTool->>QueryTool: Include AI Assistant tab conditionally
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
The test failure here is the flakey test fixed in #9723 |
…ENABLED is set to False. Fixes #9709
Summary by CodeRabbit
Release Notes
Bug Fixes
Improvements