Skip to content

Fix inverted USE_SANDBOX env var logic - #3

Open
stefangordon wants to merge 1 commit into
bengineer19:mainfrom
stefangordon:fix-use-sandbox-logic
Open

Fix inverted USE_SANDBOX env var logic#3
stefangordon wants to merge 1 commit into
bengineer19:mainfrom
stefangordon:fix-use-sandbox-logic

Conversation

@stefangordon

Copy link
Copy Markdown

Problem

USE_SANDBOX is derived with inverted logic:

USE_SANDBOX = os.getenv("USE_SANDBOX", "true").lower() == "false"

This evaluates to True precisely when the env var is set to false. So a user following the README and setting USE_SANDBOX=false for production actually gets routed to the sandbox endpoint, and their production credentials fail with:

OAuth error: 401 - {"ErrorMessage":"Invalid clientId", ...}

Fix

Compare against "true" so the flag matches its name and the documented behavior:

USE_SANDBOX = os.getenv("USE_SANDBOX", "true").lower() == "true"
  • USE_SANDBOX=true → sandbox
  • USE_SANDBOX=false → production
  • unset → defaults to sandbox (unchanged)

Verified locally: with USE_SANDBOX=false the server now requests a token from PRODUCTION and reaches === SERVER READY ===.

🤖 Generated with Claude Code

USE_SANDBOX was set to True when the env var equaled "false", so
setting USE_SANDBOX=false (production) actually routed requests to the
sandbox endpoint, causing "Invalid clientId" 401s for production
credentials. Compare against "true" instead so the flag matches the
documented behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant