Simplify prompt report orchestration

This commit is contained in:
2026-07-31 17:08:33 +00:00
parent e1bc174ea9
commit 41df5058ba
2 changed files with 305 additions and 253 deletions

View File

@@ -568,8 +568,9 @@ func finalizeRenderedReport(ctx context.Context, req finalizeRenderedReportReque
return result, err
}
result.OutputPath = req.OutputPath
req.ExecutionArtifact.Paths.OutputPath = req.OutputPath
if _, err := req.Store.SavePromptExecution(ctx, req.Resolved, *req.ExecutionArtifact); err != nil {
if err := persistReachedPromptPath(ctx, req.Store, req.Resolved, req.ExecutionArtifact, func(paths *state.PromptExecutionPaths) {
paths.OutputPath = req.OutputPath
}); err != nil {
return result, err
}
} else {
@@ -598,8 +599,9 @@ func finalizeRenderedReport(ctx context.Context, req finalizeRenderedReportReque
result.Notification = notification
metadata.NotificationPath = notificationPath
result.Metadata = metadata
req.ExecutionArtifact.Paths.NotificationPath = notificationPath
if _, saveErr := req.Store.SavePromptExecution(ctx, req.Resolved, *req.ExecutionArtifact); saveErr != nil {
if saveErr := persistReachedPromptPath(ctx, req.Store, req.Resolved, req.ExecutionArtifact, func(paths *state.PromptExecutionPaths) {
paths.NotificationPath = notificationPath
}); saveErr != nil {
return result, saveErr
}
metadataPath, saveErr := req.Store.SaveMetadata(ctx, metadata)