Newer Anthropic models increasingly emit malformed tool calls for third-party edit schemas
Opus 4.8 and Sonnet 5 sometimes invent extra fields in nested edit-tool arguments, breaking compatibility with non-Claude harnesses like Pi.
1 source · cross-referenced
- Newer Anthropic models (Opus 4.8, Sonnet 5) sometimes add invented keys to the edits[] array when calling third-party edit tools, causing schema validation failures.
- Older Anthropic models did not exhibit this issue, suggesting a regression tied to RL-based tool-use training.
- Claude’s built-in edit tool uses search-and-replace; OpenAI’s Codex uses an apply_patch mechanism, reflecting differing tool-use training approaches.
Armin Ronacher reports that Anthropic’s Opus 4.8 and Sonnet 5 models sometimes call the edit tool in the Pi coding harness with extra, invented fields in the nested edits[] array. The edit itself is usually correct, but the added keys do not match the schema, causing Pi to reject the tool call and request a retry.
This issue is not present in older Anthropic models, indicating a regression that correlates with newer releases. Armin hypothesizes the regression stems from reinforcement learning that optimized models for Claude Code’s built-in edit tool, which uses a search-and-replace mechanism, rather than third-party harnesses with different schemas.
Claude’s edit tool uses search and replace, while OpenAI’s Codex uses an apply_patch mechanism. OpenAI has previously discussed training models specifically to use apply_patch effectively, highlighting divergent tool-use training approaches across providers.
The phenomenon raises a practical question for third-party harnesses like Pi: whether to implement multiple edit tools so users can select the variant best supported by their underlying model.
- Jul 2, 2026 · Simon Willison — everything
Claude Sonnet 5 launches with 1M token context window, new tokenizer, and adaptive thinking enabled by default
Trust79 - Jul 1, 2026 · TechCrunch — AI
Anthropic releases Claude Sonnet 5 with stronger agentic capabilities and lower pricing
Trust79 - Jun 30, 2026 · OpenAI — News
OpenAI engineers fix 18-year-old infrastructure bug using core dump epidemiology
Trust79