auth status JSON reports a quota service failure as a rejected credential

Aberta
#310 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
47/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
bun, typescript
Domínio
api, cli

Direção de pesquisa

Start at the auth status command in src/main.ts and trace how quota lookup errors and region detection affect JSON output, exit codes, and stderr. Reproduce the supplied cases with the Bun preload fetch stub, comparing HTTP 503 with HTTP 401 and the invalid key code 2049. Done when a quota outage is distinguishable from rejected credentials for a known region and the unknown region behavior is clarified.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Reproduction

Tested against main at ae29aae57b05c2140c7ea6aba0a852763ffe7859.
From the repository root after installing its Bun dependencies, run the CLI
with an empty configuration directory, a synthetic key, and a fetch stub.
The stub makes no network requests.

config_dir=$(mktemp -d)
cat > "$config_dir/mock-usage.ts" <<'TS'
globalThis.fetch = async () => new Response(null, { status: 503 });
TS

MMX_CONFIG_DIR="$config_dir" CI=1 bun --preload "$config_dir/mock-usage.ts" \
  src/main.ts auth status --output json --non-interactive \
  --api-key test-api-key --region global

Actual behavior

The CLI exits with code 0 and reports authenticated: false with
Not authenticated. and a login hint. An explicit HTTP 401 and an HTTP 200
with the invalid-key code 2049 produce the same result. A successful usage
response produces the usual credential source, masked key, and usage record.

Omitting --region global sends the same simulated 503 through automatic
region detection. That path exits with code 1, leaves stdout empty, and
reports an inconclusive region on stderr.

Expected behavior

A quota service outage should be distinguishable from an explicit credential
rejection in machine-readable output. Should the CLI report an unavailable
quota lookup in the status JSON when the region is known? Should automatic
region detection keep its current stderr and exit-code behavior when the
region is unknown?

Linguagem predominante
TypeScript
Estrelas
2.2k
Forks
200
Merge médio
1d 5h
PRs com merge (30d)
3

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de MiniMax-AI/cli

Todas as issues de MiniMax-AI/cli

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.