fix(FN-4606): stabilize resolver callsites and test expectations

Ref: Runfusion/Fusion#321
Fusion-Task-Id: FN-4606
Fusion-Task-Lineage: 94b23f37-944e-4bcd-bfa1-67d0a8c0a267
This commit is contained in:
Fusion
2026-05-15 08:55:33 -07:00
committed by gsxdsm
parent edfd6e42ac
commit a8bde08d26
5 changed files with 7 additions and 6 deletions

View File

@@ -357,7 +357,7 @@ describe("TaskExecutor worktree naming", () => {
worktree: "/tmp/test/.worktrees/swift-falcon",
branch: "fusion/fn-030",
});
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test");
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test", expect.any(Object));
});
it("does NOT use task ID as worktree directory name for fresh worktrees", async () => {
@@ -421,7 +421,7 @@ describe("TaskExecutor worktree naming", () => {
await executor.execute(makeTask("FN-032", stalePath));
expect(store.updateTask).toHaveBeenCalledWith("FN-032", { worktree: null, branch: null });
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test");
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test", expect.any(Object));
const worktreeAddCalls = mockedExecSync.mock.calls.filter(
(call) => typeof call[0] === "string" && call[0].includes("git worktree add"),
);
@@ -524,7 +524,7 @@ describe("TaskExecutor worktree naming", () => {
worktree: "/tmp/test/.worktrees/swift-falcon",
branch: "fusion/fn-045",
});
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test");
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test", expect.any(Object));
});
it("defaults to random naming when worktreeNaming is undefined", async () => {
@@ -546,7 +546,7 @@ describe("TaskExecutor worktree naming", () => {
worktree: "/tmp/test/.worktrees/swift-falcon",
branch: "fusion/fn-046",
});
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test");
expect(mockedGenerateWorktreeName).toHaveBeenCalledWith("/tmp/test", expect.any(Object));
});
it("ignores worktreeNaming setting when using pooled worktree (recycle mode)", async () => {

View File

@@ -7452,6 +7452,7 @@ Backward compat fallback: if JSON is unavailable, you may still begin output wit
? await this.planSquashImportFromDep(taskId, resolvedStartPoint, startPoint)
: null;
const initialStartPoint = squashImport ? squashImport.mainBase : resolvedStartPoint;
const settings = await this.store.getSettings();
for (let attempt = 0; attempt < this.MAX_WORKTREE_RETRIES; attempt++) {
try {

View File

@@ -307,7 +307,7 @@ describe("InProcessRuntime", () => {
expect(gitExecCalls).toHaveLength(0);
expect(gitExecFileCalls).toHaveLength(0);
expect(gitSpawnCalls).toHaveLength(0);
expect(mockReapOrphanWorktrees).toHaveBeenCalledWith(testDir);
expect(mockReapOrphanWorktrees).toHaveBeenCalledWith(testDir, expect.any(Object));
expect(mockIsGitRepository).toHaveBeenCalledWith(testDir);
expect(mockScanIdleWorktrees).toHaveBeenCalled();
} finally {

View File

@@ -10,6 +10,7 @@ import {
type MissionFeature,
type PrInfo,
type AgentStore,
type Settings,
} from "@fusion/core";
import { existsSync } from "node:fs";
import { readFile } from "node:fs/promises";

View File

@@ -15,7 +15,6 @@ import { promisify } from "node:util";
const execAsync = promisify(exec);
import { existsSync } from "node:fs";
import { join } from "node:path";
import type { AgentSession } from "@mariozechner/pi-coding-agent";
import type { AgentStore, MessageStore, PermanentAgentGatingContext, TaskDetail, Settings, TaskStore } from "@fusion/core";
import { resolvePersistAgentThinkingLog } from "@fusion/core";