Concurrent MCP OAuth token saves can lose credentials
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
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- authentication, backend, security
Línea de trabajo
The issue is in packages/coding-agent/src/step/mcp-oauth.ts. Look at the saveTokens method and the publish function. The repo already uses proper-lockfile for auth.json; examine how that lock is implemented. You'll need to apply a similar cross-process lock around the read-modify-write sequence for .credentials.json. Create a unique temporary file for the write before the atomic rename. Test by simulating concurrent OAuth token saves from two Step processes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened?
MCP OAuth token updates use an unlocked read-modify-write of .credentials.json. Both createStoredMcpOAuthProvider().saveTokens() and loginMcpServer().saveTokens() load the whole store, change one server entry, then rename a replacement file. Two Step processes saving different servers can both read the same old store; the second rename drops the first process's new token.
Steps to reproduce
Use one config root with two MCP servers and run two Step processes. Trigger both OAuth token saves concurrently. If both processes read the store before either rename, the final file contains only the update from the last writer. The relevant read/update and publish paths are synchronous but unguarded across processes.
Expected behavior
Lock the credential store across processes around reload, update, and publish, then release in finally. This repo already uses proper-lockfile for auth.json; its documented lock API supports retries and realpath: false for a missing target. The MCP SDK awaits saveTokens, so the provider can use an async lock. Use a unique temporary path for publication.
Version
main @ cb5fc1456d49d49c62e072bfed2926220083214e
AI-assisted report; source path checked against the stated commit.
- Lenguaje dominante
- TypeScript
- Estrellas
- 654
- Forks
- 55
- Merge medio
- 1 d 12 h
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 stepfun-ai/Step-Code
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
stepfun-ai/Step-Code#218 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/build bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stepfun-ai/Step-Code#190 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
area/tools bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stepfun-ai/Step-Code#186 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/tools bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stepfun-ai/Step-Code#185 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/tools bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stepfun-ai/Step-Code#184 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de stepfun-ai/Step-Code
Issues similares
-
bug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
agent-task risk:low
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
guyellis/http-status-check#512 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/playwright#43327 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/TypeScript#64758 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
Los mantenedores suelen responder en 2 días