mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-06-08 16:33:58 +02:00
fix: copy deliverables to audit-logs once at workflow end instead of per-agent
Moves the copyDeliverablesToAudit call from runAgentActivity (called after every agent) to logWorkflowComplete (called once at workflow end). This prevents intermediate agent runs from copying incomplete or rogue deliverables into the audit trail.
This commit is contained in:
@@ -258,13 +258,6 @@ async function runAgentActivity(
|
||||
});
|
||||
await commitGitSuccess(repoPath, agentName);
|
||||
|
||||
// 9.5. Copy deliverables to audit-logs (non-fatal)
|
||||
try {
|
||||
await copyDeliverablesToAudit(sessionMetadata, repoPath);
|
||||
} catch (copyErr) {
|
||||
console.error(`Failed to copy deliverables to audit-logs for ${agentName}:`, copyErr);
|
||||
}
|
||||
|
||||
// 10. Return metrics
|
||||
return {
|
||||
durationMs: Date.now() - startTime,
|
||||
@@ -717,4 +710,11 @@ export async function logWorkflowComplete(
|
||||
await auditSession.initialize(workflowId);
|
||||
await auditSession.updateSessionStatus(summary.status);
|
||||
await auditSession.logWorkflowComplete(summary);
|
||||
|
||||
// Copy all deliverables to audit-logs once at workflow end (non-fatal)
|
||||
try {
|
||||
await copyDeliverablesToAudit(sessionMetadata, repoPath);
|
||||
} catch (copyErr) {
|
||||
console.error('Failed to copy deliverables to audit-logs:', copyErr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user