Skip to content

agent/loop.py terminates on any text response that doesn't involve a tool call (e.g., status update) #705

Description

@alekwo

Despite the instructions in the context, not to use messages for updates, when working with the MiniMax m2.5 model it sometimes sends messagea that look like interim responses, for example acknowledgements of the task or status updates:

  • "You're right. Let me investigate"
  • "Status: Investigating now. Will report back with findings and fix."
    Considering that it will be able to continue working on the problem.
    However, any such response is terminating the main agent loop, effectively preventing the agent from fulfilling its promise.

There should be a change in the logic to allow for interim messages, allow the agent to continue the work, and to detect the true finish of the task.

Activity

  1. sqrdao-intern commented on Feb 17, 2026

    @sqrdao-intern

    Same issue with Gemini 2.5 Flash models

  2. kmou424 commented on Feb 18, 2026

    @kmou424

    same here with gpt-4.1/gpt-5-mini (GitHub Copilot)

  3. reopened this on Feb 21, 2026
  4. Re-bin commented on Feb 21, 2026

    @Re-bin
    Collaborator

    Hey! Thanks for reporting this.

    We initially addressed this in #825 by adding a retry mechanism — if the model returns text without tool calls, the framework retries once to give it another chance to call tools. But we found several problems with this approach:

    1. Every pure-text conversation wastes a second LLM call — even a simple "hi" triggers two API calls
    2. The retry sends the same input, so the model usually does the same thing again — it doesn't actually fix the problem for models like MiniMax m2.5
    3. It introduced a regression where valid first responses could be lost, requiring a follow-up patch (fix: preserve interim content as fallback when retry produces empty response #887)

    We've since removed the retry mechanism entirely and replaced it with a system prompt constraint:

    If you need to use tools, call them directly — never send a preliminary message like "Let me check" without actually calling a tool.

    This addresses the root cause at the prompt level with zero runtime cost. Models that follow instructions will behave correctly; models that don't are unlikely to be fixed by a blind retry either.

    See the PR: #928

  5. chengyongru commented on Mar 16, 2026

    @chengyongru
    Collaborator

    Because this issue has been inactive for a long time, I will close it. If there are any other problems, please feel free to open a new issue.

  6. added a commit that references this issue on Mar 22, 2026
  7. added 2 commits that reference this issue on Mar 24, 2026
    730de29
    417a91c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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