fix(mcp): fall back to lane cwd when source_repo is null

Adopted lanes have source_repo = null; lane-mcp.js passed it raw to
readSourceMcpServers and threw ENOMCPCONFIG. Match the existing fallback
pattern in lane-env.js/lane-profile.js.
This commit is contained in:
2026-08-13 15:36:36 +07:00
parent b0bfc66d65
commit 18a42873b2
2 changed files with 11 additions and 3 deletions
+7
View File
@@ -79,6 +79,13 @@ describe("syncMcp — reading and relocating", () => {
`${lane.cwd}/.playwright-mcp/profiles/default`
);
});
it("falls back to the lane's own cwd when source_repo is null (adopted lane)", async () => {
const lane = makeLane(null);
writeClaudeJson({ [lane.cwd]: { mcpServers: { playwright: { command: "npx", args: [] } } } });
const result = await laneMcp.syncMcp(lane);
assert.deepEqual(result.servers, ["playwright"]);
});
});
describe("syncMcp — Playwright output-dir pinning", () => {