From cf1f849b68a9b01b879ad439fa38811b19ea7044 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Mon, 4 May 2026 00:31:33 +0700 Subject: [PATCH] Update MCP create_agent test to match async branch auto-name 7c85341a moved first-agent branch auto-naming out of the worktree service (sync slugify) into the workflow layer (async LLM call). The MCP test stubs createPaseoWorktree, bypassing the workflow, so the placeholder mnemonic branch is never renamed at this layer. Replace the obsolete sync-slugify outcome assertion with a placeholder-presence check; the auto-name logic itself is covered in worktree-branch-name-generator.test.ts. --- packages/server/src/server/agent/mcp-server.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/server/src/server/agent/mcp-server.test.ts b/packages/server/src/server/agent/mcp-server.test.ts index 1c3587918..e0434a52d 100644 --- a/packages/server/src/server/agent/mcp-server.test.ts +++ b/packages/server/src/server/agent/mcp-server.test.ts @@ -683,7 +683,7 @@ describe("create_agent MCP tool", () => { } }); - it("auto-names a create_agent branch-off worktree from the initial prompt without metadata branch rename", async () => { + it("creates a create_agent branch-off worktree without invoking the legacy metadata branch rename", async () => { const { agentManager, agentStorage, spies } = createTestDeps(); const tempDir = await mkdtemp(join(tmpdir(), "paseo-mcp-agent-worktree-name-context-")); const repoDir = join(tempDir, "repo"); @@ -737,9 +737,11 @@ describe("create_agent MCP tool", () => { }); const agentCwd = spies.agentManager.createAgent.mock.calls[0]?.[0].cwd as string; - expect( - execSync("git branch --show-current", { cwd: agentCwd, stdio: "pipe" }).toString().trim(), - ).toBe("fix-workspace-creation-naming"); + const initialBranch = execSync("git branch --show-current", { cwd: agentCwd, stdio: "pipe" }) + .toString() + .trim(); + expect(initialBranch).not.toBe(""); + expect(initialBranch).not.toBe("main"); await new Promise((resolve) => setTimeout(resolve, 0)); expect(workspaceGitService.getSnapshot).not.toHaveBeenCalled(); expect(broadcasts).toHaveLength(1);