Copied from upstream: SWE-agent/mini-swe-agent#737
Original author: @RobinChiu
Originally created: 2026-02-09
Describe the bug
When FormatError with no tool or json.loads, it will raise the FormatError exception. It didn't add the assistant message to history, it will cause
- mini-extra inspect didn't see the error format mesasage and the step number is not correct.
- LLM server lack the error format message will be not able to correct it. It will over the step limit and stop.

Describe the bug
When FormatError with no tool or json.loads, it will raise the FormatError exception. It didn't add the assistant message to history, it will cause