fix: update session.json status on workflow completion
logWorkflowComplete wrote to workflow.log but never called updateSessionStatus, leaving all workspaces stuck as "in-progress" in session.json. Also derive audit path for model injection instead of requiring explicit outputPath.
This commit is contained in:
@@ -393,13 +393,12 @@ export async function assembleReportActivity(input: ActivityInput): Promise<void
|
|||||||
* This must be called AFTER runReportAgent to add the model information to the Executive Summary.
|
* This must be called AFTER runReportAgent to add the model information to the Executive Summary.
|
||||||
*/
|
*/
|
||||||
export async function injectReportMetadataActivity(input: ActivityInput): Promise<void> {
|
export async function injectReportMetadataActivity(input: ActivityInput): Promise<void> {
|
||||||
const { repoPath, outputPath } = input;
|
const { repoPath, sessionId, outputPath } = input;
|
||||||
if (!outputPath) {
|
const effectiveOutputPath = outputPath
|
||||||
console.log(chalk.yellow('⚠️ No output path provided, skipping model injection'));
|
? path.join(outputPath, sessionId)
|
||||||
return;
|
: path.join('./audit-logs', sessionId);
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
await injectModelIntoReport(repoPath, outputPath);
|
await injectModelIntoReport(repoPath, effectiveOutputPath);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const err = error as Error;
|
const err = error as Error;
|
||||||
console.log(chalk.yellow(`⚠️ Error injecting model into report: ${err.message}`));
|
console.log(chalk.yellow(`⚠️ Error injecting model into report: ${err.message}`));
|
||||||
@@ -716,5 +715,6 @@ export async function logWorkflowComplete(
|
|||||||
|
|
||||||
const auditSession = new AuditSession(sessionMetadata);
|
const auditSession = new AuditSession(sessionMetadata);
|
||||||
await auditSession.initialize(workflowId);
|
await auditSession.initialize(workflowId);
|
||||||
|
await auditSession.updateSessionStatus(summary.status);
|
||||||
await auditSession.logWorkflowComplete(summary);
|
await auditSession.logWorkflowComplete(summary);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user