fix(config): drop --base-url flag and MINIMAX_BASE_URL env - #211
Open
AndersHsueh wants to merge 1 commit into
Open
fix(config): drop --base-url flag and MINIMAX_BASE_URL env#211AndersHsueh wants to merge 1 commit into
AndersHsueh wants to merge 1 commit into
Conversation
baseUrl is now sourced from config.json's base_url field (or, after OAuth login, the oauth.resource_url field stored alongside it). The --base-url global flag and the MINIMAX_BASE_URL env var are no longer honored. Background: an external tool setting MINIMAX_BASE_URL was getting intercepted by mmx and breaking its own routing. base_url is also fully redundant with mmx config set --key base_url, so the explicit overrides are removed. - src/command.ts: drop --base-url from GLOBAL_OPTIONS - src/registry.ts: drop --base-url line from help text - src/types/flags.ts: drop baseUrl? field from GlobalFlags - src/config/loader.ts: shorten baseUrl chain to file.base_url || file.oauth?.resource_url || REGIONS[region] || REGIONS.global - src/args.ts: explicitly reject --base-url with a CLIError(USAGE) pointing at `mmx config set --key base_url`, so users no longer see their input silently dropped - src/errors/handler.ts: refresh stale MINIMAX_BASE_URL example in the "fetch failed" branch comment - test/config/loader.test.ts: add 7 cases for the baseUrl source chain (file wins, region fallback, env ignored, malformed URL fallback). Uses MMX_CONFIG_DIR for cross-platform isolation. - test/args.test.ts: add 3 cases for the --base-url rejection (space form, = form, and a happy-path smoke test) Verified: 358 non-SDK tests pass; 14 pre-existing SDK failures are unrelated (network-dependent integration tests). bun run lint and bun run typecheck both clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
What
Drop the
--base-urlglobal flag and theMINIMAX_BASE_URLenv var.baseUrlis now sourced only fromconfig.json'sbase_urlfield (or, after OAuth login, theoauth.resource_urlfield stored alongside it).Why
An external tool was setting
MINIMAX_BASE_URLin the user's shell, expecting mmx to leave it alone. mmx was intercepting it and breaking that tool's own routing. base_url is also fully redundant withmmx config set --key base_url --value <url>, so the explicit overrides are removed.Changes
src/command.ts— drop--base-urlfromGLOBAL_OPTIONSsrc/registry.ts— drop--base-urlline from help textsrc/types/flags.ts— dropbaseUrl?field fromGlobalFlagssrc/config/loader.ts— shorten baseUrl chain tofile.base_url || file.oauth?.resource_url || REGIONS[region] || REGIONS.globalsrc/args.ts— explicitly reject--base-urlwith aCLIError(USAGE)pointing atmmx config set --key base_url, so users no longer see their input silently droppedsrc/errors/handler.ts— refresh staleMINIMAX_BASE_URLexample in thefetch failedbranch commentTests
test/config/loader.test.ts— 7 new cases for the baseUrl source chain (file wins, region fallback, env ignored, malformed URL fallback). UsesMMX_CONFIG_DIRfor cross-platform isolation.test/args.test.ts— 3 new cases for the--base-urlrejection (space form,=form, and a happy-path smoke test).bun test: 358/358 non-SDK tests pass. The 14 SDK failures are pre-existing and unrelated (live API integration tests that need network + a valid key).bun run lint: clean.bun run typecheck: clean.Side effects
mmx search query --base-url https://...now errors withFlag --base-url was removed.and a migration hint.export MINIMAX_BASE_URL=...is silently ignored — the user's~/.mmx/config.json(or region default) wins. No warning by design.mmx config set --key base_url --value <url>.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.