fix(core): Add recursive loop detection and move loop detection (#101)

* fix(core): Add recursive loop detection and move loop detection

Signed-off-by: Richard Palethorpe <io@richiejp.com>

* fix(ci): Free up space after installation to avoid out of space error

Signed-off-by: Richard Palethorpe <io@richiejp.com>

---------

Signed-off-by: Richard Palethorpe <io@richiejp.com>
This commit is contained in:
Richard Palethorpe
2025-04-30 14:51:43 +01:00
committed by GitHub
parent 45dd74d27c
commit 8abf5512a4
4 changed files with 45 additions and 28 deletions

View File

@@ -480,13 +480,18 @@ func (a *Agent) pickAction(job *types.Job, templ string, messages []openai.ChatC
}, c...)
}
reasoningAction := action.NewReasoning()
thought, err := a.decision(job,
c,
types.Actions{action.NewReasoning()}.ToTools(),
action.NewReasoning().Definition().Name.String(), maxRetries)
types.Actions{reasoningAction}.ToTools(),
reasoningAction.Definition().Name.String(), maxRetries)
if err != nil {
return nil, nil, "", err
}
if thought.actioName != "" && thought.actioName != reasoningAction.Definition().Name.String() {
return nil, nil, "", fmt.Errorf("Expected reasoning action not: %s", thought.actioName)
}
originalReasoning := ""
response := &action.ReasoningResponse{}
if thought.actionParams != nil {