You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR refactors LLM provider selection logic to respect existing BYOK configurations and ensures a reliable default Minds URL across the codebase.
anton/chat.py: Extracted _has_configured_byok and _switch_to_minds_as_llm helpers; replaced automatic provider override with an interactive user prompt; added BYOK detection for openai and openai-compatible providers via ANTON_OPENAI_API_KEY
anton/cli.py: _setup_other_provider now sets settings.minds_url to 'https://mdb.ai' instead of None
anton/minds_client.py: normalize_minds_url signature updated to str | None; returns 'https://mdb.ai' early when input is None or blank; simplified scheme-prefix guard
Confidence Score: 5/5 - Safe to Merge
Safe to merge — this PR cleanly refactors LLM provider selection logic in anton/chat.py by extracting _has_configured_byok and _switch_to_minds_as_llm helpers, replacing an implicit override with an explicit interactive prompt, and hardening _setup_other_provider in anton/cli.py with a reliable default minds_url of 'https://mdb.ai'. The changes are well-scoped, no review comments were generated, and the heuristic analysis found zero issues across all three changed files. The refactor improves both readability and user experience without introducing new risk surfaces.
Key Findings:
_has_configured_byok centralizes BYOK detection for both openai and openai-compatible providers using ANTON_OPENAI_API_KEY, eliminating scattered conditional logic and reducing the chance of missed detection paths.
Replacing the automatic provider override in anton/chat.py with an interactive user prompt is a safer UX pattern — it avoids silently mutating user configuration and gives users explicit control over their provider choice.
Pinning settings.minds_url to 'https://mdb.ai' in _setup_other_provider eliminates any risk of an unset or empty URL causing downstream failures when the Minds provider is selected.
All three changed files were reviewed with full coverage, and no critical, significant, or medium-severity issues were identified by the heuristic analysis.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow users to use BYOK when querying minds