Simplify prompt report orchestration
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user