Skip to content

Agent keep retrying until hit max_retires on function calling #981

Open
@ZihaoFU245

Description

@ZihaoFU245
  • Agent SDK version (v 0.1.0)
  • Python version 3.13, using uv (0.7.12)

This is the code that create the issue, short.

Bug description

I use Ollama local model ( gemma3n:e4b ), with some fake email tools which save the email info into json files, when i am letting the LLM send a email request, I can see from the file, the agent called the tools, but it keeps trying though the tool calling is successful and hit the max retry error.

  • I am thinking the issue is the ollama model did not see the returned success information so it keeps trying (from the different email body content), but there is too few command line debug information, i can't be 100% sure what is happening.

Reproduced behaviour

  • download ollama and pull gemma3n:e4b
  • run the script
  • only needs openai-agent SDK
    The agent should be keep trying to call the function tool but do not give response until max retry error triggered

New feature expecting

Some detailed information showing where the error is occured.
Is the error occured at agent-sdk or LiteLLM?
Is the error occured at LLM response?

Some debug message like this would be helpful

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions