Newer Claude models such as Opus 4.8 and Sonnet 5 have been observed to generate malformed tool calls when invoking Pi's edit function.
Newer Claude models such as Opus 4.8 and Sonnet 5 have been observed to generate malformed tool calls when invoking Pi's edit function. They add keys that do not match the expected schema. The edit tool expects a path parameter and an edits array containing objects with oldText and newText fields. Validation rejects calls that contain additional properties. Across multiple test runs, the newer models produced extra fields such as requireUnique, type, id, or children, causing the tool call to fail. The issue was reproduced in an agentic session where the model had read files and composed a multi‑line edit, occurring in roughly 20 % of attempts. Earlier versions of the model, including Opus 4.5, did not show this behavior. The author hypothesizes that the issue stems from post‑training that exposed the model to Claude Code’s edit tool, which uses a flatter schema and tolerates additional parameters. Reinforcement learning in that environment may reward successful completion despite schema deviations, leading the model to learn a broader set of acceptable keys. Strict mode in the tool invocation interface appears to eliminate the problem by preventing sampling of unsupported fields. The case illustrates that tool schemas are not neutral for all model families and that harness developers may need more explicit schema validation to ensure compliance.
- Publisher
- Hacker News
- Reliability
- high
- Published
- 7/5/2026, 10:00:37 AM
- Retrieved
- 7/5/2026, 10:00:37 AM
- Relevance
- 80%
- Confidence
- 85%

