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

Abierto
#310 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
47/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
bun, typescript
Área
api, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?

Lenguaje dominante
TypeScript
Estrellas
2.2k
Forks
200
Merge medio
1 d 5 h
PR fusionados (30 d)
3

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MiniMax-AI/cli

Todos los issues de MiniMax-AI/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.