From f017a4143614a975531d59b38972244a05520702 Mon Sep 17 00:00:00 2001 From: ezl-keygraph Date: Fri, 13 Feb 2026 22:09:07 +0530 Subject: [PATCH] fix: set originalWorkflowId in logPhaseTransition and remove path import from agents.ts logPhaseTransition was the first activity to create session.json but didn't pass workflowId, so originalWorkflowId was never set. This caused terminateExistingWorkflows to look up the workspace name instead of the actual workflow ID during resume. Also remove path import from types/agents.ts to fix Temporal workflow bundle determinism error. --- src/temporal/activities.ts | 4 ++-- src/types/agents.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/temporal/activities.ts b/src/temporal/activities.ts index 40fcf4f..2e544dd 100644 --- a/src/temporal/activities.ts +++ b/src/temporal/activities.ts @@ -678,7 +678,7 @@ export async function logPhaseTransition( phase: string, event: 'start' | 'complete' ): Promise { - const { webUrl, repoPath, outputPath, sessionId } = input; + const { webUrl, repoPath, outputPath, sessionId, workflowId } = input; const sessionMetadata: SessionMetadata = { id: sessionId, @@ -688,7 +688,7 @@ export async function logPhaseTransition( }; const auditSession = new AuditSession(sessionMetadata); - await auditSession.initialize(); + await auditSession.initialize(workflowId); if (event === 'start') { await auditSession.logPhaseStart(phase); diff --git a/src/types/agents.ts b/src/types/agents.ts index 481346a..041e0f3 100644 --- a/src/types/agents.ts +++ b/src/types/agents.ts @@ -8,8 +8,6 @@ * Agent type definitions */ -import path from 'path'; - /** * List of all agents in execution order. * Used for iteration during resume state checking. @@ -118,5 +116,5 @@ export function getDeliverablePath(agentName: AgentName, repoPath: string): stri }; const filename = deliverableMap[agentName]; - return path.join(repoPath, 'deliverables', filename); + return `${repoPath}/deliverables/${filename}`; }