#6740·openhuman

[TinyAgents] A malformed tool block next to a valid call is dropped silently (no nudge)

Author: M3gA-MindCreated Sep 28, 2026Updated Sep 28, 2026
Labelspriority: p1

Summary

Follow-up to #6723 (fixed by tinyhumansai/tinyagents#224). The new re-prompt for a text-dialect tool block that is claimed but undecodable fires only when the response produced no decoded calls. If one response has a valid call and an undecodable block, the valid call runs, the second call silently does not, and the model gets no signal that it was dropped. It can then finish the task with only part of the work done.

Where

tinyagents-harness/src/agent_loop/run_loop.rs at tinyagents 773c0432 (≈:1555):

rust
if tool_calls.is_empty()
    && (response.finish_reason.as_deref() == Some("tool_calls") || undecodable_text_call)
    && tools_available_this_turn
    && dropped_tool_call_nudges_used < self.policy.dropped_tool_call_nudges

recovery.dropped.malformed() / unterminated() do count the bad block, but the tool_calls.is_empty() gate discards that count as soon as any call decoded. This was noted in the #224 review ("1 good call + 1 undecodable block silently drops the second") and flagged again by CodeRabbit on #6726.

Expected

When a response contains at least one valid call and at least one claimed-but-undecodable block, run the valid calls. Then, after their results, append a notice that says the malformed call did not run (not "no tool ran") and asks the model to re-issue it in the protocol format. The notice should draw on the same nudge budget.

Acceptance

  • A regression test with a mixed response: one valid call plus one malformed block. The valid tool runs, the follow-up notice appears after its result, and the wording names the malformed call as not run.
  • A response with only valid calls is unchanged. A response with only malformed blocks keeps #224's behaviour.

Routing

The code lives in tinyagents (tinyagents-harness); the fix PR goes to tinyhumansai/tinyagents from a fork, and openhuman then picks it up through a gitlink bump.