fix(computer): Agents on Anthropic models fail every turn with 401 "invalid x-api-key" when only DeepSeek credentials are injected
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
Direzione di ricerca
Start by reading the Pi runtime configuration and model credential handling described in the issue; the payload does not name source files or tests. Trace how ANTHROPIC_BASE_URL and the selected model’s catalogue baseUrl are resolved, then check whether a linked pull request already addresses the behavior. Done means Anthropic model runs either use the configured compatible gateway or fail early with a clear missing credential message.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened
Any Agent whose model is an Anthropic model fails every turn with a raw provider error, while Agents on a DeepSeek model keep working in the same Room at the same time:
401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"},"request_id":"req_011Ch..."}
Direct chat with an Agent on a DeepSeek model is unaffected, which makes it look like "chat works, Rooms are broken".
The model picker still offers anthropic/* models on a Computer that has no Anthropic credential. Selecting one looks fine, and the failure only shows up later, per turn, as a provider 401.
Steps to reproduce
- On a Computer whose only model credentials are DeepSeek (free tier or BYOK DeepSeek), create or edit an Agent and set its model to an Anthropic model (e.g.
claude-haiku-4-5/claude-opus-5-5). - Open a Room with that Agent and mention it.
- Every turn of that Agent fails with the 401 above; Agents on
deepseek/deepseek-flashin the same Room answer normally.
Minimal reproduction outside Linger with the runtime environment Linger injects:
pi -p "reply with OK" --provider anthropic --model claude-haiku-4-5 --no-session
# 401 {"type":"error","error":{"type":"authentication_error","message":"invalid x-api-key"},"request_id":"req_011Ch..."}
env -u ANTHROPIC_AUTH_TOKEN -u ANTHROPIC_API_KEY -u ANTHROPIC_BASE_URL \
pi -p "reply with OK" --provider anthropic --model claude-haiku-4-5 --no-session
# No API key found for anthropic.
Area
Agents and runs
Version
0.1.10
Environment
- Linger 0.1.10 (release build), macOS 26.5.2, Apple Silicon, local TeamHub
- Agent runtime: Pi (pi-coding-agent 1.5.2),
preferredRuntime: pi
Logs
Daemon log, once per failed turn:
{"event":"runtime.operation.failed","runtime_type":"pi","level":"ERROR","error":"401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"invalid x-api-key\"},\"request_id\":\"req_011ChM15NdGPAYQrnYkJa7Kz\"}"}
The Pi session for the same Agent records the model up front:
{"type":"model_change","provider":"anthropic","modelId":"claude-haiku-4-5"}
Across runtime homes on this Computer, Agents whose model is anthropic/* have failures; Agents whose model is deepseek/deepseek-flash have none.
Why it happens: the runtime environment carries only DeepSeek credentials — DEEPSEEK_API_KEY plus the same key in ANTHROPIC_AUTH_TOKEN, with ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic — while Pi's anthropic provider resolves baseUrl from the model catalogue (https://api.anthropic.com) and ignores ANTHROPIC_BASE_URL. The DeepSeek key is therefore sent to the real Anthropic API as x-api-key and rejected. The same bogus key sent to the DeepSeek Anthropic-compatible endpoint returns a different envelope (Authentication Fails, Your api key: ****-123 is invalid (request_id: <uuid>)), so the 401 above comes from Anthropic, not from DeepSeek.
Either of these would be enough:
- Fail the run at start with an explicit message ("this Agent's model needs an Anthropic credential; none is configured on this Computer") instead of a raw 401 per turn.
- Let the runtime's
ANTHROPIC_BASE_URLwin over the cataloguebaseUrl, so an Anthropic-compatible gateway can serveanthropic/*models. - Hide or block Anthropic models in the picker on Computers with no Anthropic credential.
- Lingua principale
- TypeScript
- Stelle
- 3.8k
- Fork
- 360
- Merge medio
- 8h 10m
- PR unite (30g)
- 540
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di simplexai-labs/linger
-
bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
simplexai-labs/linger#904 ·
I maintainer di solito rispondono entro 1 giorno
-
Local model JIT load waits ~22 s for a concurrency probe that always ends unmeasured and is never cachedForse già presa @oldwinter53 l’ha presa oggi. Apertabug
simplexai-labs/linger#896 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
feat(agents): let an Agent choose runtime, model and reasoning effort when it creates an AgentAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
simplexai-labs/linger#888 ·
I maintainer di solito rispondono entro 1 giorno
-
Hand-patches to the protected runtime are silently discarded on upgrade, with no supported overrideAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
simplexai-labs/linger#883 ·
I maintainer di solito rispondono entro 1 giorno
-
Daily memory report silently never runs: 5-minute step ceiling plus a stuck in-memory #scheduled setAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
simplexai-labs/linger#881 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di simplexai-labs/linger
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Bug Nethernet Tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JSPrismarine/JSPrismarine#3949 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
withkarann/aifoxx#504 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni