server: DELETE /auth/{id} removes credential but GET /provider still reports it connected; returns 200 true for unknown ids
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- api, authentication, backend
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 225k
- Forks
- 30.4k
- Merge medio
- 4 h 16 min
- PR fusionados (30 d)
- 528
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
anomalyco/opencode#62873 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#62822 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anomalyco/opencode#62601 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#62516 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
anomalyco/opencode#62374 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
code-quality good-first-issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenRailAssociation/netzgrafik-editor-frontend#1481 ·
Los mantenedores suelen responder en 1 día
-
🙌 icon request
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
lucide-icons/lucide#5183 ·
Los mantenedores suelen responder en 1 día
-
Unhandled rejection when a call fails before delivery and an argument is an imported promiseAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 81/100
cloudflare/capnweb#293 ·
Los mantenedores suelen responder en 2 días
-
bug implicit-state
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
-
area:models enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día