Skip to content
Back to skills

2494 2026 02 21 Minimax Tool Call Bugs 3aa542ef

ASecurity

MiniMax M2.5 returns tool calls with empty `id` and sometimes empty `name` fields. Our Python code rejects empty strings in three places. The tinyagent Rust layer (alchemy-llm) handles IDs correctly via `ToolCallId` with `Into` trait -- this is NOT a tinyagent bug.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
ai-agentspythonrusttestinggit

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2494-2026-02-21_minimax-tool-call-bugs_3aa542ef --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2494 2026 02 21 Minimax Tool Call Bugs 3aa542ef?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2494 2026 02 21 Minimax Tool Call Bugs 3aa542ef
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2494-2026-02-21-minimax-tool-call-bugs-3aa542ef/badge)](https://www.skillsdirectory.com/skills/tools-only-2494-2026-02-21-minimax-tool-call-bugs-3aa542ef)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
type: delta
date: 2026-02-21
status: open
tags: [minimax, tool-call, bug]
---

# MiniMax Tool Call Bugs -- Handoff

## Root Cause

MiniMax M2.5 returns tool calls with empty `id` and sometimes empty `name` fields. Our Python code rejects empty strings in three places. The tinyagent Rust layer (alchemy-llm) handles IDs correctly via `ToolCallId` with `Into` trait -- this is NOT a tinyagent bug.

## Three rejection sites (all ours)

1. **`src/tunacode/core/types/tool_registry.py:44`** -- `register()` raises `ValueError("tool_call_id is required")` on empty string
2. **`src/tunacode/utils/messaging/adapter.py:155`** -- `_coerce_tool_call_item()` raises `TypeError` on empty `id`
3. **`src/tunacode/core/agents/resume/sanitize.py:147`** -- raises `TypeError` on empty `id`

Fix: generate fallback UUID at each site instead of raising. Registry fix requires adding `tool_id_map: dict[str, str]` to `_TinyAgentStreamState` (`main.py:75`) so the end handler resolves fallback IDs.

## `read_file` argument mismatch

MiniMax ignores the JSON schema parameter name `filepath`. Unknown what key it actually sends -- debug logging attempt failed because logger level was DEBUG (filtered out). Use `logging.warning` to capture actual `args` dict in `decorators.py` `execute()` before `sig.bind()`.

Once you know the actual key, add it to the alias list in `_normalize_tool_args`.

System prompt examples should use JSON object format (`read_file({"filepath": "..."})`) not function-call syntax, since that's what the model actually emits.

## `@file` resolution

Not yet implemented. Add `normalize_agent_message_text` to `repl_support.py` to resolve `@path` tokens to absolute paths. Wire into `app.py` `on_editor_submit_requested`. Note: `@` triggers editor autocomplete, so tmux send-keys won't work for testing -- test manually or via unit test.

## Dependency

Bump `tiny-agent-os>=1.2.3` in `pyproject.toml` (separate from these bugs, but needed for other fixes in that release).

## Stash

`git stash list` has a previous attempt. Partially usable code for `decorators.py` normalization and `repl_support.py` @file resolution. The rest was wrong.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…