Update computer-use-demo to use text_editor_20250728 exclusively with correct insert_text parameter#352
Merged
zealoushacker merged 3 commits intoanthropics:mainfrom Feb 5, 2026
Conversation
- 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
51c3e4a to
5ae0f02
Compare
zealoushacker
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the computer-use-demo to use only the latest text editor tool version (
text_editor_20250728), removing the olderEditTool20250124andEditTool20241022classes.Motivation
The demo previously maintained three tool versions with an inheritance chain. The oldest versions used
new_stras the parameter name for theinsertcommand, but thetext_editor_20250728API schema usesinsert_text. This mismatch caused issues when the model tried to use the insert command with the correct parameter name.Changes
edit.py: RemovedEditTool20250124andEditTool20241022. MadeEditTool20250728a standalone class (no longer inherits from older versions). It uses:insert_textas the parameter name for the insert command (matching the API schema)str_replace_based_edit_toolas the tool nameundo_editcommand (removed in newer tool versions)groups.py: Updated all tool groups to useEditTool20250728__init__.py: Updated exports to only includeEditTool20250728edit_test.py: Simplified tests to only testEditTool20250728withinsert_textparameter. Removedtest_undo_edit_command(not supported in this version).Fixes #348
Refs anthropics/anthropic-sdk-python#1155