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

未关闭
#310 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
47/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
bun, typescript
领域
api, cli

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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?

主要语言
TypeScript
星标
2.2k
派生
200
平均合并
1 天 5 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MiniMax-AI/cli 的其他 Issue

查看 MiniMax-AI/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。