feat: add resume header to workflow.log showing previous workflow ID and checkpoint
This commit is contained in:
@@ -485,17 +485,29 @@ export async function restoreGitCheckpoint(
|
||||
}
|
||||
|
||||
/**
|
||||
* Record a resume attempt in session.json.
|
||||
* Record a resume attempt in session.json and write resume header to workflow.log.
|
||||
*/
|
||||
export async function recordResumeAttempt(
|
||||
input: ActivityInput,
|
||||
terminatedWorkflows: string[],
|
||||
checkpointHash: string
|
||||
checkpointHash: string,
|
||||
previousWorkflowId: string,
|
||||
completedAgents: string[]
|
||||
): Promise<void> {
|
||||
const sessionMetadata = buildSessionMetadata(input);
|
||||
const auditSession = new AuditSession(sessionMetadata);
|
||||
await auditSession.initialize();
|
||||
|
||||
// Update session.json with resume attempt
|
||||
await auditSession.addResumeAttempt(input.workflowId, terminatedWorkflows, checkpointHash);
|
||||
|
||||
// Write resume header to workflow.log
|
||||
await auditSession.logResumeHeader({
|
||||
previousWorkflowId,
|
||||
newWorkflowId: input.workflowId,
|
||||
checkpointHash,
|
||||
completedAgents,
|
||||
});
|
||||
}
|
||||
|
||||
// === Phase Transition Activities ===
|
||||
|
||||
@@ -178,11 +178,13 @@ export async function pentestPipelineWorkflow(
|
||||
return state;
|
||||
}
|
||||
|
||||
// Record resume attempt in session.json
|
||||
// Record resume attempt in session.json and write resume header to workflow.log
|
||||
await a.recordResumeAttempt(
|
||||
activityInput,
|
||||
input.terminatedWorkflows || [],
|
||||
resumeState.checkpointHash
|
||||
resumeState.checkpointHash,
|
||||
resumeState.originalWorkflowId,
|
||||
resumeState.completedAgents
|
||||
);
|
||||
|
||||
log.info('Resume state loaded and workspace restored');
|
||||
|
||||
Reference in New Issue
Block a user