Unify optional interaction capture and warnings
This commit is contained in:
@@ -47,13 +47,20 @@ func executePipeline(ctx context.Context, loaded *processInputs, prepared *prepa
|
||||
item.CaptureProposalExchange = true
|
||||
}
|
||||
}
|
||||
debugPath := prepared.DebugPath()
|
||||
var interactions structuredoutput.InteractionSink
|
||||
var writer *llm.DiagnosticsWriter
|
||||
if debug != nil {
|
||||
writer = llm.NewDiagnosticsWriter(debug.Path())
|
||||
interactions = writer
|
||||
}
|
||||
output, runErr := runner.New(modules.NewFactory()).Run(ctx, runner.RunInput{
|
||||
Config: cfg, Transcript: normalized, ModuleSpecs: specs,
|
||||
ProposalDiagnosticsDir: debugPath, ValidationDiagnosticsDir: debugPath,
|
||||
CaptureCandidates: debugPath != "", ReportDiagnosticError: warn,
|
||||
Interactions: interactions, CaptureCandidates: debug != nil,
|
||||
})
|
||||
if debug != nil {
|
||||
for _, warning := range writer.Warnings() {
|
||||
warn(warning)
|
||||
}
|
||||
warn(debug.WriteJSONArtifact(diagnostics.ArtifactLLMExecution, processreport.BuildLLMExecution(observer.Snapshot())))
|
||||
warn(debug.WriteJSONArtifact(diagnostics.ArtifactCorrectionLedger, processreport.BuildCorrectionLedger(processreport.CorrectionLedgerInput{RunDirectoryPath: debug.Path(), RunOutput: &output})))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user