feat: add resume header to workflow.log showing previous workflow ID and checkpoint

This commit is contained in:
ajmallesh
2026-02-16 17:21:12 -08:00
parent bb89d6f458
commit 9074149778
4 changed files with 60 additions and 4 deletions
+28
View File
@@ -87,6 +87,34 @@ export class WorkflowLogger {
return this.logStream.write(header);
}
/**
* Write resume header to log file when workflow is resumed
*/
async logResumeHeader(resumeInfo: {
previousWorkflowId: string;
newWorkflowId: string;
checkpointHash: string;
completedAgents: string[];
}): Promise<void> {
await this.ensureInitialized();
const header = [
``,
`================================================================================`,
`RESUMED`,
`================================================================================`,
`Previous Workflow ID: ${resumeInfo.previousWorkflowId}`,
`New Workflow ID: ${resumeInfo.newWorkflowId}`,
`Resumed At: ${formatTimestamp()}`,
`Checkpoint: ${resumeInfo.checkpointHash}`,
`Completed: ${resumeInfo.completedAgents.length} agents (${resumeInfo.completedAgents.join(', ')})`,
`================================================================================`,
``,
].join('\n');
return this.logStream.write(header);
}
/**
* Format timestamp for log line (local time, human readable)
*/