Skip to content

mcode provider add --use fails with "Test the saved provider configuration" but saves nothing #157

Description

@superbigcup325

mcode 0.4.12, npm install, Linux, Node v26.8.2

The BYOK example in the README ends with --use:

mcode provider add --name my-provider --base-url https://example.com/v1 \
  --api-format openai-completions --model my-model \
  --api-key-env MCODE_PROVIDER_API_KEY --use

Running it exits 1 with:

Test the saved provider configuration before activating it

Nothing is saved. mcode provider list does not show the provider, and
mcode provider test <name> reports "Model provider not found".

Two problems:

  1. The message says "Test the saved provider configuration", but the provider
    was never written — the check runs before any persistence.
  2. Headless users get a wrong signal afterwards: mcode exec fails with
    "Sign in to MiniMax to use Agent features", which sends people off to
    mcode login when the real problem is the provider was never stored.

Retrying without --use does work ("Provider added: my-provider"), followed by
mcode provider test — so the workaround is just dropping --use.

Suggestion: either save first and then require provider test before
activating, or make the message state that nothing was saved and print the
working sequence. Also worth updating the README example, since it sends every
new BYOK user into this on their first run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions