Concurrent MCP OAuth token saves can lose credentials
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 850
- フォーク
- 62
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 43
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stepfun-ai/Step-Code のほかの issue
-
area/build bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#190 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area/tools bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#186 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/tools bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#185 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area/tools bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#184 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stepfun-ai/Step-Code#179 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
stepfun-ai/Step-Code の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
siyuan-note/siyuan#20517 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
NaturalIntelligence/fast-xml-parser#890 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
zsviczian/obsidian-excalidraw-plugin#3000 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pnpm/get.pnpm.io#68 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nuxt-modules/better-auth#578 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信