feat: per-user LLM provider configuration with toggle-based default selection and pre-flight validation - #16
feat: per-user LLM provider configuration with toggle-based default selection and pre-flight validation#16ZhenhangTung with Copilot wants to merge 10 commits into
Conversation
…d API keys - Add cryptography dependency for Fernet encryption - Create encryption utility (encrypt_value/decrypt_value) - Add UserLLMConfig model with encrypted API key storage - Add serializers, views, and URL routes for CRUD operations - Update LLM config to support per-user provider configuration - Add comprehensive tests for encryption, model, and API endpoints Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
…configuration - Create llmConfig.js service for LLM config CRUD operations - Add Models tab with CpuChipIcon to settings dialog in ConsoleLayout - Add provider cards for Gemini and OpenRouter with status badges - Add masked API key display for configured providers - Add inline API key update form and delete confirmation dialog - Add i18n translations (EN + zh-CN) for model configuration UI Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
|
@copilot Requirement 1: Default Model Provider Selection Requirement 2: Pre-flight Configuration Validation
If validation fails, the UI should:
|
- Add is_default field to UserLLMConfig model with single-default enforcement - Add /api/accounts/llm-configs/readiness/ endpoint for pre-flight checks - Update get_default_provider() to prioritize user's explicit default - Add migration for is_default field - Add 6 new tests (default provider, readiness endpoint) Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
- Add "Set as default" / "Default" badge to provider cards in Models tab - Add pre-flight LLM readiness check before workspace creation - Show warning banner and auto-open Settings → Models when validation fails - Add checkLLMReadiness() service function - Add i18n translations (EN + zh-CN) for default/readiness UI strings - ConsoleLayout accepts openSettingsTab/onSettingsClosed props Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
- Move readiness URL before uuid pattern to avoid routing conflict - Extract inline onClose to handleCloseSettings function - Add logger.warning to exception catches in LLM config module Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
|
@copilot UX Logic Question: Why is there a "Delete" button for the default provider? Does it mean "Remove default status" or "Delete the provider entirely"? This is ambiguous. Proposed Solution: Replace the delete button with a toggle switch component for default provider selection:
|
…itch for default provider - Replace "Set as default" button and "Delete" button with Headless UI Switch toggle - Toggle is disabled when provider has no API key configured - Only one provider can be ON at a time (mutually exclusive via backend enforcement) - Prevent toggling OFF the current default (must always have one) - Move "Remove" (delete API key) to subtle text link next to masked key - Add aria-label to Remove button for accessibility - Update i18n translations Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
Replaced the "Delete"/"Set as default" buttons with a Headless UI
|
|
@copilot no need to add a (fixed) string suffix after the model name |
Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
Removed the "(fixed)" suffix in |
|
@copilot pls use Gemini 3 Pro instead of 2.5 Pro |
Co-authored-by: ZhenhangTung <8170159+ZhenhangTung@users.noreply.github.com>
Updated to "Gemini 3 Pro" in both EN and zh-CN translations in |






Per-user LLM model provider configuration with encrypted API keys
Completed
get_provider_config()/get_default_provider()is_defaultfield with single-default enforcement per user/api/accounts/llm-configs/readiness/endpointScreenshots
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.