feat(auth): force subscription-only mode for Claude provider#166
Open
Maury1329 wants to merge 1 commit intoAutoForgeAI:masterfrom
Open
feat(auth): force subscription-only mode for Claude provider#166Maury1329 wants to merge 1 commit intoAutoForgeAI:masterfrom
Maury1329 wants to merge 1 commit intoAutoForgeAI:masterfrom
Conversation
Prevent accidental API credit consumption by explicitly disabling API authentication when using the default Claude provider. This ensures users with Claude Code subscriptions don't inadvertently incur API charges. Changes: - Add safety check in client.py to reject API credentials for Claude provider - Modify registry.py to explicitly clear API auth env vars in Claude mode - Add user-facing confirmation messages for subscription mode
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.
Summary
Prevents accidental API credit consumption by explicitly enforcing subscription-only mode when using the default Claude provider. This ensures users with Claude Code subscriptions don't inadvertently incur API charges.
Changes
client.pyRuntimeErrorifANTHROPIC_API_KEYorANTHROPIC_AUTH_TOKENare detected in Claude moderegistry.pyget_effective_sdk_env()to explicitly clear API authentication env varsANTHROPIC_API_KEYandANTHROPIC_AUTH_TOKENin Claude modeMotivation
Previously, the system would forward existing environment variables which could lead to:
Testing
Breaking Changes
None - This is a safety enhancement that only affects Claude provider configuration.
Labels: