[W&B SWE agent](https://www.youtube.com/watch?v=Y5-ZmEzqatI) uses an interesting approach to achieve top score on SWE-bench Verified, inspired by collapse a specific range in a code editor: - `open_module(path)`: view a file with all functions collapsed by default <details> <summary>Example output</summary> <img width="184" alt="Image" src="https://github.com/user-attachments/assets/bf3a258e-a70a-431c-8f93-238467cfb738" /> </details> - `expand_function(path, fn_name)`: view that file again but with the `fn_name` function expanded <details> <summary>Example output</summary> <img width="188" alt="Image" src="https://github.com/user-attachments/assets/bce90727-634b-43c0-b7ea-24e79470ce7d" /> <img width="194" alt="Image" src="https://github.com/user-attachments/assets/a6477c44-b33b-44a0-9648-e6875be69fe3" /> </details> We can implement this by adjusting the `str_replace_editor` tool: - Modify the `view` command on file path to print file content with functions collapsed by default - Add an extra command `expand_function`
W&B SWE agent uses an interesting approach to achieve top score on SWE-bench Verified, inspired by collapse a specific range in a code editor:
open_module(path): view a file with all functions collapsed by defaultExample output
expand_function(path, fn_name): view that file again but with thefn_namefunction expandedExample output
We can implement this by adjusting the
str_replace_editortool:viewcommand on file path to print file content with functions collapsed by defaultexpand_function