server: DELETE /auth/{id} removes credential but GET /provider still reports it connected; returns 200 true for unknown ids
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- api, authentication, backend
Direzione di ricerca
Start by tracing the server handlers for DELETE /auth/{id} and GET /provider, then follow how the provider catalog gets its connected state and how stored credentials are deleted. Check the related API tests or add coverage for deleting an existing id and an unknown id. Done when /provider reflects deletion immediately and deleting an unknown id returns an error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
opencode serve serves stale auth state over HTTP: DELETE /auth/{providerId} deletes the credential from ~/.local/share/opencode/auth.json, but GET /provider continues to include the id in its connected array until the server restarts. DELETE /auth/<unknown-id> silently returns 200 true even when nothing was deleted, so clients cannot detect a no-op.
Environment
- opencode version: 2.2.6 (also reproduced via image ghcr.io/anomalyco/opencode:latest)
- OS: Darwin 25.5.0 (arm64); server itself ran inside Docker
- Shell: zsh (client is a plain
curl, terminal not relevant) - Install/channel: latest (homebrew opencode-v2)
- Active plugins: none
Reproduction
- Start
opencode servewith an OAuth credential present, e.g.openaiin~/.local/share/opencode/auth.json. - Request
curl http://server/auth/openai -X DELETE(with basic auth against the server) → returnstrue, HTTP 200. - Read
auth.jsonon disk → theopenaikey is gone. - Request
curl http://server/provider→connectedstill containsopenai. - Restart the server and repeat the
GET /provider→connectednow matchesauth.json.
Also: DELETE /auth/__nonexistent__ → returns true with HTTP 200, even though no such credential existed.
Expected Behavior
GET /providershould reflect credential deletion immediately (in-memory auth catalog invalidated on delete).DELETE /auth/{id}for an id with no stored credential should return an error (e.g. 404) instead of success, so API clients can distinguish real logout from a no-op.
Actual Behavior
DELETE reports true/200 both for a real and a nonexistent provider id; /provider's connected stays stale until process restart. Client UIs that briefly confirm the deletion and re-query /provider show the provider as still connected, which reads as "logout not working".
Additional Context
Discovered while a project dashboard called DELETE /auth/openai, refreshed its status from GET /provider right after, and still displayed the provider as connected despite auth.json on disk being updated and the mtime confirming the delete happened. docker restart opencode-server cleared the stale connected list; rewriting/touching the opencode config file (which normally triggers config reload) did not clear it, so the stale state appears to live in the in-memory provider catalog rather than config.
- Lingua principale
- TypeScript
- Stelle
- 225k
- Fork
- 30.4k
- Merge medio
- 4h 16m
- PR unite (30g)
- 528
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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 anomalyco/opencode
-
reproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
anomalyco/opencode#62873 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#62822 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anomalyco/opencode#62601 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
reproduced
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
anomalyco/opencode#62516 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
anomalyco/opencode#62374 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di anomalyco/opencode
Issue simili
-
code-quality good-first-issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenRailAssociation/netzgrafik-editor-frontend#1481 ·
I maintainer di solito rispondono entro 1 giorno
-
🙌 icon request
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
lucide-icons/lucide#5183 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 81/100
cloudflare/capnweb#293 ·
I maintainer di solito rispondono entro 2 giorni
-
bug implicit-state
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
area:models enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno