Infinite tool call
- Dominant language
- TypeScript
- Stars
- 349
- Forks
- 92
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 24
Description
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 ?
```ts
export const assistantAgent = new Agent(components.agent, {
name: "Agent",
languageModel: gpt5nano,
textEmbeddingModel: textEmbeddingModel,
instructions: instructions,
tools: { promptBuilder, generateImage },
stopWhen: [hasToolCall("generateImage")],
//[...]
maxSteps: 5,
});
```
Contributor guide
Research direction
Start with the Agent configuration shown in the issue, reproduce the repeated tool call with maxSteps set to 5, and inspect the stopWhen condition around generateImage. Done means the repeated calls stop as intended and the configured maximum of five steps is respected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100