Skip to content

Bug: Tool call ID not invalidated after 400 error — causes persistent failures across sessions #16472

@yunxiujun

Description

@yunxiujun

Description

When a tool call fails with an HTTP 400 error from MiniMax API (minimax-cn provider), the returned tool_call_id is not properly invalidated. Subsequent new sessions continue to reuse the same invalidated tool_call_id, causing every request to fail with:

Error code: 400 - {'type': 'error', 'error': {'type': 'bad_request_error', 'message': 'invalid params, invalid function arguments json string, tool_call_id: call_function_XXXXX_1 (2013)', 'http_code': '400'}

Evidence

The same pattern has reproduced multiple times across different dates:

  • 2026-04-26: call_function_18464z1gskgy_1 → 400, reused across ~5 sessions
  • 2026-04-26: call_function_bgfd4km3qnvm_1 → 400, reused across ~3 sessions
  • 2026-04-27: call_function_41ojma24zxdp_1 → 400, reused across 4+ sessions

Each time a new tool_call_id appears on first failure, it then gets "stuck" and reused in all subsequent sessions until the Hermes service is restarted.

Steps to Reproduce

  1. Use MiniMax provider (minimax-cn) with tools enabled
  2. Trigger any tool call that produces a 400 error (e.g., malformed parameters)
  3. Observe that all subsequent sessions also fail with the same tool_call_id

Expected Behavior

When a tool call returns a 400 error, Hermes should:

  • Invalidate that tool_call_id
  • Generate a fresh tool_call_id for subsequent requests
  • Not persist or cache the failed ID across sessions

Environment

  • Provider: MiniMax (minimax-cn)
  • Model: MiniMax-M2.7
  • Base URL: https://api.minimaxi.com/v1
  • Platform: Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/minimaxMiniMax (Anthropic transport)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions