LLM model/API behavior drift
Anthropic Claude API text editor tool undo_edit command rejected legacy text editor version
A tool-use agent fails only when the hosted model tries to invoke editing.
Agent Quick Fix
Repair against the current Claude API contract, then keep the change narrow and source-backed.
Product: Claude API
Current-contract area: Legacy text-editor tool version and `undo_edit` command rejected
Likely root cause: A tool-use agent fails only when the hosted model tries to invoke editing.
Repair direction: Verifier checks current model ID, accepted payload, structured output/tool parsing, and behavior under retries.
Symptom
A tool-use agent fails only when the hosted model tries to invoke editing.
Why This Happens
SDK types may still accept fields that the selected hosted model rejects; model retirement, tokenizer, thinking, and tool behavior are external and fast-moving.
Common Wrong Fixes
- Changing local code without checking the current external contract.
- Retrying the same install, build, or API call with no version/source change.
- Applying a broad unsafe bypass when a narrow compatibility fix is available.
Codex Search Keywords
These are the search terms observed in a neutral Codex validation run for this failure shape.
Anthropic Claude API text editor tool undo_edit command rejected legacy text editor version
site:docs.anthropic.com text_editor undo_edit Claude API
Anthropic text_editor_20241022 undo_edit
Anthropic str_replace_editor undo_edit
Claude computer use text editor tool versions Anthropic docs
https://docs.anthropic.com/en/docs/agents-and-tools/tool-use/text-editor-tool