行业精选

新Claude模型对第三方编辑工具调用变差

Better Models: Worse Tools

精选理由

Armin发现新版Claude模型反而在Pi里用编辑工具时会乱加字段,旧版反而正常。这是模型训练方向影响第三方工具的真实案例。

AI 摘要

Armin报告在Pi编程工具中发现异常:Claude Opus 4.8和Sonnet 5调用编辑工具时,会在edits[]数组中添加不存在的字段,导致工具调用被Pi拒绝。旧版本模型(如Haiku)未出现此问题。Armin推测原因是新模型通过强化学习被训练为更适配Claude Code的内置编辑工具,从而牺牲了对第三方工具模式的兼容。这一现象提示第三方工具可能需要为不同模型实现多种编辑工具以获得最佳效果。

原文 · Simon Willison’s Weblog

Better Models: Worse Tools

Better Models: Worse Tools Armin reports on a weird problem he ran into while hacking on Pi: The short version is that newer Claude models sometimes call Pi’s edit tool with extra, invented fields in the nested edits[] array. And not Haiku or some small model: Opus 4.8. The edit itself is usually correct but the arguments do not match the schema as the model invents made-up keys and Pi thus rejects the tool call and asks to try again. That alone is not too surprising as models emit malformed tool calls sometimes. Particularly small ones. What surprised me is that this is getting worse with newer Anthropic models as both Opus 4.8 and Sonnet 5 show it but none of the older models. In other words, the SOTA models of the family are worse at this specific tool schema than their older siblings. Armin theorizes that this is because more recent Anthropic models have been specifically trained (presumably via Reinforcement Learning) to better use the edit tools that are baked into Claude Code. This has the unfortunate effect that other coding harnesses, such as Pi, may find that their own custom edit tools are more likely to be used incorrectly. Claude's edit tool uses search and replace . OpenAI's Codex uses an apply_patch mechanism instead , and OpenAI have talked in the past about how their models are trained to use that tool effectively. Does this mean third-party coding harnesses like Pi should implement multiple edit tools just so they can use the one with the best performance for the underlying model the user has selected? Tags: armin-ronacher , ai , openai , generative-ai , llms , anthropic , llm-tool-use , coding-agents , pi

新Claude模型对第三方编辑工具调用变差 · AI 热点