Give each correction repair branch its own outcome
This commit is contained in:
@@ -441,6 +441,19 @@ func runModulePipeline(ctx context.Context, input collectSectionProposalsInput)
|
||||
return out, nil
|
||||
}
|
||||
|
||||
repairPromptID := ""
|
||||
if input.Spec.Settings.LLM.CorrectionRepairAttempts > 0 {
|
||||
provider, ok := input.Module.(interface{ RepairPromptID() string })
|
||||
if !ok || input.Spec.RepairCoordinator == nil {
|
||||
return out, &structuredoutput.Failure{Class: outcomes.FailureFatal, Reason: outcomes.ReasonSetupFailure, Message: "correction repair coordinator or prompt provider is unavailable"}
|
||||
}
|
||||
repairPromptID = provider.RepairPromptID()
|
||||
if repairPromptID == "" {
|
||||
return out, &structuredoutput.Failure{Class: outcomes.FailureFatal, Reason: outcomes.ReasonSetupFailure, Message: "correction repair prompt is unavailable"}
|
||||
}
|
||||
input.Spec.CaptureProposalExchange = true
|
||||
}
|
||||
|
||||
runCtx, proposalResults, cancel := collectSectionProposals(ctx, input)
|
||||
defer cancel()
|
||||
|
||||
@@ -548,12 +561,8 @@ func runModulePipeline(ctx context.Context, input collectSectionProposalsInput)
|
||||
}
|
||||
validated, err := validateSectionCandidates(runCtx, validationInput)
|
||||
var repairs []RepairOutcome
|
||||
if err == nil && input.Spec.Settings.LLM.CorrectionRepairAttempts > 0 {
|
||||
promptID := ""
|
||||
if provider, ok := input.Module.(interface{ RepairPromptID() string }); ok {
|
||||
promptID = provider.RepairPromptID()
|
||||
}
|
||||
validated, repairs, err = repairCandidates(runCtx, validationInput, sectionResult.proposal.SegmentReferences, validated, promptID)
|
||||
if err == nil && repairPromptID != "" {
|
||||
validated, repairs, err = repairCandidates(runCtx, validationInput, sectionResult.proposal.SegmentReferences, validated, repairPromptID)
|
||||
}
|
||||
setErr(err)
|
||||
validationResults <- sectionValidationResult{
|
||||
|
||||
Reference in New Issue
Block a user