Skip to content

Update computer-use-demo to use text_editor_20250728 exclusively with correct insert_text parameter#352

Merged
zealoushacker merged 3 commits intoanthropics:mainfrom
arturenault:fix/text-editor-insert-param
Feb 5, 2026
Merged

Update computer-use-demo to use text_editor_20250728 exclusively with correct insert_text parameter#352
zealoushacker merged 3 commits intoanthropics:mainfrom
arturenault:fix/text-editor-insert-param

Conversation

@arturenault
Copy link
Contributor

@arturenault arturenault commented Feb 5, 2026

Summary

Updates the computer-use-demo to use only the latest text editor tool version (text_editor_20250728), removing the older EditTool20250124 and EditTool20241022 classes.

Motivation

The demo previously maintained three tool versions with an inheritance chain. The oldest versions used new_str as the parameter name for the insert command, but the text_editor_20250728 API schema uses insert_text. This mismatch caused issues when the model tried to use the insert command with the correct parameter name.

Changes

  • edit.py: Removed EditTool20250124 and EditTool20241022. Made EditTool20250728 a standalone class (no longer inherits from older versions). It uses:
    • insert_text as the parameter name for the insert command (matching the API schema)
    • str_replace_based_edit_tool as the tool name
    • No undo_edit command (removed in newer tool versions)
  • groups.py: Updated all tool groups to use EditTool20250728
  • __init__.py: Updated exports to only include EditTool20250728
  • edit_test.py: Simplified tests to only test EditTool20250728 with insert_text parameter. Removed test_undo_edit_command (not supported in this version).

Fixes #348
Refs anthropics/anthropic-sdk-python#1155

@arturenault arturenault marked this pull request as draft February 5, 2026 20:05
- Remove EditTool20250124 and EditTool20241022 classes
- Make EditTool20250728 a standalone class (no inheritance from old versions)
- Uses insert_text parameter (not new_str) for the insert command
- Uses str_replace_based_edit_tool as the tool name
- Does not support undo_edit (removed in newer versions)
- Update groups.py to use EditTool20250728 for all tool groups
- Update __init__.py exports to only include EditTool20250728
- Update tests to only test EditTool20250728 with insert_text parameter

Fixes anthropics#348
Fixes anthropics/anthropic-sdk-python#1155
@arturenault arturenault force-pushed the fix/text-editor-insert-param branch from 51c3e4a to 5ae0f02 Compare February 5, 2026 20:19
@arturenault arturenault changed the title Fix: EditTool20250429/20250728 insert command uses insert_text, not new_str Update computer-use-demo to use text_editor_20250728 exclusively with correct insert_text parameter Feb 5, 2026
@arturenault arturenault marked this pull request as ready for review February 5, 2026 20:22
@zealoushacker zealoushacker self-requested a review February 5, 2026 20:43
@zealoushacker zealoushacker merged commit 4b2549e into anthropics:main Feb 5, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: text_editor insert command expects new_str but model outputs insert_text

2 participants

Comments