From 71bd999586b2ee285b91b5bcc7cea20d2bb73567 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 17 Mar 2026 17:10:30 +0000 Subject: [PATCH] story-kit: create 270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port --- ..._test_server_overwrites_root_mcp_json_with_wrong_port.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.story_kit/work/1_upcoming/270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port.md b/.story_kit/work/1_upcoming/270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port.md index d212000..f9193c9 100644 --- a/.story_kit/work/1_upcoming/270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port.md +++ b/.story_kit/work/1_upcoming/270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port.md @@ -6,7 +6,11 @@ name: "QA test server overwrites root .mcp.json with wrong port" ## Description -When the QA agent starts a test server in a worktree (e.g. on port 3012), that server auto-detects the shared project root and calls open_project, which writes .mcp.json with the test server's port. This clobbers the root .mcp.json that should always point to the main server (port 3001). Root cause: open_project in server/src/io/fs.rs:527 unconditionally calls write_mcp_json(&p, port) with its own port, regardless of whether another server instance already owns the project. +When the QA agent starts a test server in a worktree (e.g. on port 3012), that server auto-detects the shared project root and calls open_project, which writes .mcp.json with the test server's port. This clobbers the root .mcp.json that should always point to the main server (port 3001). + +Root cause: open_project in server/src/io/fs.rs:527 unconditionally calls write_mcp_json(&p, port) with its own port. Because worktrees share .story_kit/ with the real project, the test server resolves to the real project root and overwrites the root .mcp.json instead of writing to its own worktree directory. + +Fix: Remove the write_mcp_json call from open_project entirely. Worktree .mcp.json files are already written correctly during worktree creation (worktree.rs:81,97), and the root .mcp.json is committed in git. open_project should not touch it. ## How to Reproduce