fix(planning): don't loose results

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-03-26 16:58:11 +01:00
parent 8e9b87bcb1
commit d5df14a714
2 changed files with 10 additions and 8 deletions

View File

@@ -528,7 +528,9 @@ func (a *Agent) consumeJob(job *types.Job, role string) {
return
}
if err := a.handlePlanning(ctx, job, chosenAction, actionParams, reasoning, pickTemplate, conv); err != nil {
var err error
conv, err = a.handlePlanning(ctx, job, chosenAction, actionParams, reasoning, pickTemplate, conv)
if err != nil {
job.Result.Finish(fmt.Errorf("error running action: %w", err))
return
}