[bug] request Authorization header uses root-level api_key instead of active profile key; config show disagrees with the wire; config edits have no effect
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- authentication, cli
Direção de pesquisa
Start by tracing how the CLI selects credentials for requests and how bl config show resolves the active profile; the report does not name source files or tests. Reproduce with a profile base_url and api_key, then compare the verbose Authorization mask against the active profile key. Done when requests use the active profile's key and the config view matches the key sent.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
CLI version
2.3.1
Skill version (optional)
2.3.1
Node version
n/a (standalone binary install channel, no Node on machine)
OS
Windows 10 10.0.19045 x86_64 (MINGW64/Git Bash)
Region
cn
Command to reproduce
bl video task get --task-id 00000000-0000-0000-0000-000000000000 --verbose
Expected behavior
The Authorization header should match the active profile's api_key — the same key bl config show reports as active — so the request authenticates against the profile's base_url.
Actual behavior
- The
> Auth:mask printed by--verbosematches the ROOT-level api_key [REDACTED root-level key], while the request URL is the PROFILE's base_url (token-plan regional endpoint) → HTTP 401 InvalidApiKey (request_id: 04ad1d6d-68ff-4a1e-ab6b-562fb8956883, a79cdf7b-a2d0-40ed-9e51-59a2daa02c6e). bl config showreports the PROFILE key [REDACTED profile key] as active — the CLI's own config view contradicts what is sent on the wire.- Removing the root-level
api_keyfromconfig.jsondoes NOT change the key sent on the wire (same root-key mask on the next request) → suggests a credential store outsideconfig.jsonsilently takes precedence. - Explicit
--config <profile>does not change the sent key either. - Control experiments: root key + root base_url → HTTP 200; profile endpoint + explicitly passed valid profile key → HTTP 200. Only the mixed pairing (root key + profile endpoint) fails — which is what the CLI produces by itself.
- Reproduced on both 1.27.0 and 2.3.1 (on 2.3.1 the wrong Auth header is visible in --verbose before the unrelated HTTP crash of #263).
Full output
> GET https://token-plan.cn-beijing.maas.aliyuncs.com/api/v1/tasks/00000000-0000-0000-0000-000000000000
> Auth: [REDACTED root-level key]
> x-dashscope-source-config: {"channel":"bailian-cli","tags":{"t1":"public","t2":"bl","t3":"1.27.0"}}
< 401 Unauthorized
request_id: 04ad1d6d-68ff-4a1e-ab6b-562fb8956883
Error: Invalid API-key provided.
Status: HTTP 401 (InvalidApiKey)
Exit code: 1
JSON error (optional)
Already tried
- bl update and skill version aligned with CLI
- bl auth status OK for this command
- Different network / region — still reproduces
How often does this happen?
Always
How was bl invoked?
Agent (Cursor, Claude, etc.)
Notes (optional)
- Related: #171 (closed) covered 401s for the upload-policy endpoint under token-plan profiles; this report is about the broader credential precedence/mixing affecting every request.
- Security/UX concern: a key the user can no longer see or edit in
config.jsonkeeps being used; there is no documented way to inspect or clear that external credential store viabl. - Attribution: automatically drafted and submitted by the agentic assistant (model: qwen3.8-max) of Qoder CN Desktop v0.4.3 (build 0.4.3.0) on behalf of the account owner, who reviewed and approved the content before submission.
- Linguagem predominante
- TypeScript
- Estrelas
- 475
- Forks
- 34
- Merge médio
- 19h 34min
- PRs com merge (30d)
- 34
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de modelstudioai/cli
-
[bug] Local media upload is pinned to China endpoint; Singapore workspace API key fails getPolicy (401 InvalidApiKey)Talvez já em andamento @Uddoo assumiu há 3 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 54/100
modelstudioai/cli#267 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
modelstudioai/cli#239 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
modelstudioai/cli#202 · 2 comentários · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
modelstudioai/cli#195 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
modelstudioai/cli#190 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de modelstudioai/cli
Issues semelhantes
-
area:agent-view area:tui bug platform:macos
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
anthropics/claude-code#104558 ·
Mantenedores costumam responder em até 1 dia
-
updater
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
UniversityOfHelsinkiCS/oodikone#5141 ·
-
maintanance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
inmanta/web-console#7606 ·
Mantenedores costumam responder em até 1 dia
-
bug skills
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
equinor/fusion-framework#5846 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 74/100