Skip to content

Implement batch command for textEditor tool #388

Open
@bhouston

Description

@bhouston

Implement batch command for textEditor tool

Description

Currently, the textEditor tool only allows one edit command at a time (view, create, str_replace, insert, undo_edit). This leads to inefficient token usage when multiple small edits need to be made.

This issue proposes implementing a new batch command that would allow multiple edit operations to be executed in sequence with a single tool invocation.

Implementation Details

  1. Add a new command batch to the enum of allowed commands
  2. Define a new parameter operations that accepts an array of operations to execute
  3. Each operation in the array would have the same structure as a single command (without the description field)
  4. Execute each operation in sequence, collecting results
  5. Return a combined result with success status and details of each operation

Changes Required

  1. Update the parameter schema in textEditor.ts to include the new command and parameter
  2. Implement the batch command logic in the execute function
  3. Add tests for the batch command functionality
  4. Update documentation

Benefits

  • Improved token efficiency for multiple edit operations
  • Reduced number of tool invocations needed for common tasks
  • Better user experience for AI agents performing complex edits

Related to #387

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions