-
-
Notifications
You must be signed in to change notification settings - Fork 1k
fix(core): convert boot guard ValueError to warning for OAuth-native support #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -540,16 +540,11 @@ def custom_provider_factory(api_key=None): | |
| if registered_providers: | ||
| logger.info(f"Registered providers: {', '.join(registered_providers)}") | ||
|
|
||
| # Require at least one valid provider | ||
| # Check if OAuth-native mode is enabled or warn instead of blocking | ||
| if not valid_providers: | ||
| raise ValueError( | ||
| "At least one API configuration is required. Please set either:\n" | ||
| "- GEMINI_API_KEY for Gemini models\n" | ||
| "- OPENAI_API_KEY for OpenAI models\n" | ||
| "- XAI_API_KEY for X.AI GROK models\n" | ||
| "- DIAL_API_KEY for DIAL models\n" | ||
| "- OPENROUTER_API_KEY for OpenRouter (multiple models)\n" | ||
| "- CUSTOM_API_URL for local models (Ollama, vLLM, etc.)" | ||
| logger.warning( | ||
| "No API configurations found. Tools requiring an API model will fail. " | ||
| "However, OAuth-native local tools (like clink) will still function." | ||
| ) | ||
|
Comment on lines
+545
to
548
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning message indicates that tools like
Comment on lines
544
to
548
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Downgrading this guard to a warning does not actually enable no-API startup in the default configuration: Useful? React with 👍 / 👎. |
||
|
|
||
| logger.info(f"Available providers: {', '.join(valid_providers)}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this change converts the initial provider check to a warning, the server will still fail to boot in the default configuration because of the
IS_AUTO_MODEcheck at line 612. If no providers are found,ModelProviderRegistry.get_available_models()returns an empty dictionary, which triggers aValueErrorat line 619. To support a true 'No-API' boot as intended by this PR, the validation logic forIS_AUTO_MODE(lines 612-622) also needs to be relaxed or bypassed when no providers are available.