fix: remove empty auth env placeholders from anthropic-thirdparty and openrouter presets#243
Open
eriksun421 wants to merge 1 commit intoop7418:mainfrom
Open
fix: remove empty auth env placeholders from anthropic-thirdparty and openrouter presets#243eriksun421 wants to merge 1 commit intoop7418:mainfrom
eriksun421 wants to merge 1 commit intoop7418:mainfrom
Conversation
… openrouter presets Storing ANTHROPIC_API_KEY:"" or ANTHROPIC_AUTH_TOKEN:"" in extra_env caused inferAuthStyleFromLegacy() to detect the wrong auth style, and left confusing empty entries visible in the UI after save/reopen. Auth injection is already handled via the api_key field in toClaudeCodeEnv(), so these placeholders serve no purpose and should not be persisted. Fixes op7418#241
|
@w2sun is attempting to deploy a commit to the op7418's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fixes #241
Root Cause
anthropic-thirdpartyandopenrouterpresets were storing empty auth key placeholders ({"ANTHROPIC_API_KEY":""}or{"ANTHROPIC_AUTH_TOKEN":""}) inextra_env. This caused two problems:inferAuthStyleFromLegacy()inprovider-catalog.tsdetects auth style by checking ifANTHROPIC_AUTH_TOKENkey exists inextra_env(regardless of value), so an empty placeholder could cause the wrong auth style to be inferred.Fix
ProviderManager.tsxandProviderForm.tsxanthropic-thirdparty, strip anyANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKENkeys fromextra_envinstead of injecting empty ones — auth injection is already handled correctly via theapi_keyfield intoClaudeCodeEnv()Testing