Avoid requiring static API key for OAuth Login#100
Merged
jamiepine merged 2 commits intospacedriveapp:mainfrom Feb 21, 2026
Merged
Avoid requiring static API key for OAuth Login#100jamiepine merged 2 commits intospacedriveapp:mainfrom
jamiepine merged 2 commits intospacedriveapp:mainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
|
This is the right approach — resolving the Anthropic provider at the LlmManager level with an explicit match on all four cases (static+oauth, static-only, oauth-only, neither) is much cleaner than always registering a provider with an empty key. I had a workaround for the same issue in #84 but dropped it in favor of this. #84 now only has the MiniMax routing fix. |
Contributor
Author
Nice, makes sense! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
The addition of #76 based on #32 works by taking prescedence over the
anthropic_keyinconfig.toml.However, the main improvement of the OAuth flow with
spacebot auth loginis to avoid having a fixed API key set for anthropic.Issue
If no
anthropic_keyis set in the conf, the LLM calls will fail with a poorly descriptive messageunknown provider anthropicwhen the routing model is set toanthropic/..Solution
Resolve the anthropic key provider in the model configuration so that it can use the OAuth token even if no configuration entry for
anthropic_keyis set.Test
Prerequisites
spacebot auth login[ ] Remove
anthropic_keyfromconfig.tomlprior to this PR[ ] Bot will not respond and
-f -dwill show the unknown provider error[ ] Check out PR & run in dev
[ ] Bot is now responsive
Considerations
Having no API Keys set at all currently hows a yellow warning banner in the web dashboard.
cc @Marenz