fix(FN-4257): align heartbeat cwd acquisition fallback

Fusion-Task-Id: FN-4257
Fusion-Task-Lineage: db48d51e-9e7d-471d-b26b-2a8763fb41d1
This commit is contained in:
Fusion
2026-05-13 01:35:36 -07:00
committed by gsxdsm
parent c8a00ad10b
commit 63a7dcebef
2 changed files with 3 additions and 3 deletions

View File

@@ -2211,7 +2211,7 @@ describe("executeHeartbeat", () => {
expect(mockedCreateFnAgent).toHaveBeenCalledOnce(); expect(mockedCreateFnAgent).toHaveBeenCalledOnce();
const callArgs = mockedCreateFnAgent.mock.calls[0]![0]; const callArgs = mockedCreateFnAgent.mock.calls[0]![0];
expect(callArgs.cwd).toBe("/tmp/test"); expect(callArgs.cwd).toBe("/tmp/worktree-fn-001");
expect(callArgs.systemPrompt).toContain(HEARTBEAT_SYSTEM_PROMPT); expect(callArgs.systemPrompt).toContain(HEARTBEAT_SYSTEM_PROMPT);
expect(callArgs.systemPrompt).toContain("## Soul"); expect(callArgs.systemPrompt).toContain("## Soul");
expect(callArgs.systemPrompt).toContain("Act like a practical teammate who prioritizes clarity."); expect(callArgs.systemPrompt).toContain("Act like a practical teammate who prioritizes clarity.");

View File

@@ -2105,13 +2105,13 @@ export class HeartbeatMonitor {
} }
let sessionCwd = rootDir; let sessionCwd = rootDir;
if (!isNoTaskRun && taskDetail && heartbeatModelSettings) { if (!isNoTaskRun && taskDetail) {
try { try {
const acquisition = await acquireTaskWorktree({ const acquisition = await acquireTaskWorktree({
task: taskDetail, task: taskDetail,
rootDir, rootDir,
store: taskStore, store: taskStore,
settings: heartbeatModelSettings, settings: heartbeatModelSettings ?? {},
logger: heartbeatLog, logger: heartbeatLog,
audit, audit,
runContext, runContext,