Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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_MODE check at line 612. If no providers are found, ModelProviderRegistry.get_available_models() returns an empty dictionary, which triggers a ValueError at line 619. To support a true 'No-API' boot as intended by this PR, the validation logic for IS_AUTO_MODE (lines 612-622) also needs to be relaxed or bypassed when no providers are available.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The warning message indicates that tools like clink will still function. However, multi-turn conversations (using continuation_id) will currently fail for these tools if no API providers are configured. The reconstruct_thread_context function (specifically at line 1189) raises a ValueError when no models are available for context reconstruction, even for tools that don't require a model themselves. This effectively limits the 'OAuth-native' mode to single-turn interactions unless at least one dummy provider is configured.

Comment on lines 544 to 548

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep no-provider startup blocking when auto mode is default

Downgrading this guard to a warning does not actually enable no-API startup in the default configuration: DEFAULT_MODEL is "auto" by default (config.py), so execution continues to the later auto-mode validation (configure_providers lines 612-622) and still raises ValueError when no models exist. In practice, users with no API keys still fail at boot, but now with a misleading "restrictions" error instead of the explicit provider-missing message, which breaks the intended OAuth-native flow.

Useful? React with 👍 / 👎.


logger.info(f"Available providers: {', '.join(valid_providers)}")
Expand Down
Loading