Execute ordered pipeline steps with barriers
This commit is contained in:
@@ -59,6 +59,7 @@ type RunInput struct {
|
||||
|
||||
pipeline ResolvedPipeline
|
||||
llmClient contracts.StructuredLLMClient
|
||||
stepID string
|
||||
}
|
||||
|
||||
type RunOutput struct {
|
||||
@@ -249,12 +250,16 @@ func (r *Runner) Run(ctx context.Context, input RunInput) (output RunOutput, err
|
||||
}
|
||||
|
||||
if chunkResult.accepted {
|
||||
laneOutput, laneErr := r.runLanes(ctx, input, checkpoints, checkpointLoader, doc, sourceInput, sessionID, chunkResult.chunks)
|
||||
if err := mergeLaneOutput(&output, laneOutput); err != nil {
|
||||
return failOutput(output), err
|
||||
}
|
||||
if laneErr != nil {
|
||||
return failOutput(output), laneErr
|
||||
for _, step := range input.Prepared.Steps {
|
||||
stepInput := input
|
||||
stepInput.stepID = step.ID
|
||||
laneOutput, laneErr := r.runLanes(ctx, stepInput, step, checkpoints, checkpointLoader, doc, sourceInput, sessionID, chunkResult.chunks)
|
||||
if err := mergeLaneOutput(&output, laneOutput); err != nil {
|
||||
return failOutput(output), err
|
||||
}
|
||||
if laneErr != nil {
|
||||
return failOutput(output), fmt.Errorf("execute pipeline step %q: %w", step.ID, laneErr)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +465,10 @@ func validateRunInput(input RunInput) error {
|
||||
if mode != ChunkCacheBypass && input.ChunkPlans == nil {
|
||||
return fmt.Errorf("chunk plan store is required for %q mode", mode)
|
||||
}
|
||||
return validateResolvedPipeline(input.Prepared.resolved)
|
||||
if err := validateResolvedPipeline(input.Prepared.resolved); err != nil {
|
||||
return err
|
||||
}
|
||||
return rejectGeneratedBindings(input.Prepared.resolved)
|
||||
}
|
||||
|
||||
func validateResolvedPipeline(pipeline ResolvedPipeline) error {
|
||||
|
||||
Reference in New Issue
Block a user