block / goose

Goose is a developer agent that operates from your command line to help you do the boring stuff.
https://block.github.io/goose/
Apache License 2.0
108 stars 17 forks source link

feat: create a text editor tool with multiple commands #186

Open salman1993 opened 16 hours ago

salman1993 commented 16 hours ago

Changes:

Anthropic is using this text editor tool for Computer Use. It might be useful to try this in goose - docs, code. It seems like they prefer to have fewer tools, but each tool has more optional args which are used for specific actions. For example, in goose we have separate tools for read_file, write_file, patch_file but in this case, its a single EditorTool with command as an Enum that routes to the editor action (view, create, insert).

Test:

tool descriptions are correctly passed tool-descriptions

michaelneale commented 11 hours ago

interesting, will try this out, could be promising. I did notice that tool calling seemed to work well with parameters in the past, and even with richer CLIs - ie able to use the one "tool" different ways seems to suit it more so than choosing between tools (intuitively that makes sense, as a human, to some limited extent, you don't have the cognitive overload of choosing the tool)

michaelneale commented 9 hours ago

@salman1993 any tips on how to try it out to A/B test?

michaelneale commented 3 hours ago

tried it out with editing just one spot in a yaml file... just FYI:

The phrase "Found packages with disallowed licenses" occurs multiple times in the .github/workflows/license-check.yml file, making it necessary to be more      
specific in the string replace operation. I'll view more of the file to identify the different locations and modify them accordingly. Let's check the           
occurrences separately.                                                                                                                                         

─── .github/workflows/license-check.yml ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

         uses: actions/setup-python@v5                                                                                                                          
         with:                                                                                                                                                  
           python-version: '3.10'                                                                                                                               

       - name: Install dependencies                                                                                                                             
         run: |                                                                                                                                                 
           python -m pip install --upgrade pip                                                                                                                  
           pip install tomli requests urllib3                                                                                                                   

       - name: Check licenses                                                                                                                                   
         run: |                                                                                                                                                 
           python .github/workflows/scripts/check_licenses.py \                                                                                                 
             pyproject.toml || exit_code=$?                                                                                                                     
           if [ "${exit_code:-0}" -ne 0 ]; then                                                                                                                 
             echo "::error::Found packages with disallowed licenses"                                                                                            
             exit 1                                                                                                                                             
           fi                                                                                                                                                   

       - name: Check Exchange licenses                                                                                                                          
         run: |                                                                                                                                                 
           python .github/workflows/scripts/check_licenses.py \                                                                                                 
             packages/exchange/pyproject.toml || exit_code=$?                                                                                                   
           if [ "${exit_code:-0}" -ne 0 ]; then                                                                                                                 
             echo "::error::Found packages with disallowed licenses in exchange"                                                                                
             exit 1                                                                                                                                             
           fi                                                                                                                                                   

─── .github/workflows/license-check.yml ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

─── .github/workflows/license-check.yml ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Let's specify the contexts where we succeed the operations, starting with the first one.                                                                        

─── .github/workflows/license-check.yml ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 echo "::error::Found packages with disallowed licenses"                                                                                                        

->                                                                                                                                                              

 echo "::error::Found packages with disallowed licenses, it was in the goose package."                                                                          

─── .github/workflows/license-check.yml ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 echo "::error::Found packages with disallowed licenses in exchange"                                                                                            

->                                                                                                                                                              

 echo "::error::Found packages with disallowed licenses, it was in the goose package."

some odd artifacts like:

image

michaelneale commented 3 hours ago

so far seems to do a good job - but not pushed too hard today