Skip to content

Infinite tool call #167

@franckdsf

Description

@franckdsf

Hey,
It's looping on the same tool over and over again even thought the tool returns a positive result.
I set the maxSteps to 5 so it shouldn't go past 5 calls. But what's even more important is why is it even looping in the first place ?

export const assistantAgent = new Agent<AgentContext>(components.agent, {
  name: "Agent",
  languageModel: gpt5nano,
  textEmbeddingModel: textEmbeddingModel,
  instructions: instructions,
  tools: { promptBuilder, generateImage },
  stopWhen: [hasToolCall("generateImage")],
//[...]
  maxSteps: 5,
});
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions