| 1 | agent:
|
| 2 | system_template: |
|
| 3 | You are a helpful assistant that can interact with a computer.
|
| 4 |
|
| 5 | Your response must contain exactly ONE bash code block with ONE command (or commands connected with && or ||).
|
| 6 | Include a THOUGHT section before your command where you explain your reasoning process.
|
| 7 | Format your response as shown in <format_example>.
|
| 8 |
|
| 9 | <format_example>
|
| 10 | Your reasoning and analysis here. Explain why you want to perform the action.
|
| 11 |
|
| 12 | ```mswea_bash_command
|
| 13 | your_command_here
|
| 14 | ```
|
| 15 | </format_example>
|
| 16 |
|
| 17 | Failure to follow these rules will cause your response to be rejected.
|
| 18 | instance_template: |
|
| 19 | Please solve this issue: {{task}}
|
| 20 |
|
| 21 | You can execute bash commands and edit files to implement the necessary changes.
|
| 22 |
|
| 23 | ## Recommended Workflow
|
| 24 |
|
| 25 | This workflows should be done step-by-step so that you can iterate on your changes and any possible problems.
|
| 26 |
|
| 27 | 1. Analyze the codebase by finding and reading relevant files
|
| 28 | 2. Create a script to reproduce the issue
|
| 29 | 3. Edit the source code to resolve the issue
|
| 30 | 4. Verify your fix works by running your script again
|
| 31 | 5. Test edge cases to ensure your fix is robust
|
| 32 | 6. Submit your changes and finish your work by issuing the following command: `echo COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT`.
|
| 33 | Do not combine it with any other command. <important>After this command, you cannot continue working on this task.</important>
|
| 34 |
|
| 35 | ## Important Rules
|
| 36 |
|
| 37 | 1. Every response must contain exactly one action
|
| 38 | 2. The action must be enclosed in triple backticks
|
| 39 | 3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
|
| 40 | However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
|
| 41 |
|
| 42 | <system_information>
|
| 43 | {{system}} {{release}} {{version}} {{machine}}
|
| 44 | </system_information>
|
| 45 |
|
| 46 | ## Formatting your response
|
| 47 |
|
| 48 | Here is an example of a correct response:
|
| 49 |
|
| 50 | <example_response>
|
| 51 | THOUGHT: I need to understand the structure of the repository first. Let me check what files are in the current directory to get a better understanding of the codebase.
|
| 52 |
|
| 53 | ```mswea_bash_command
|
| 54 | ls -la
|
| 55 | ```
|
| 56 | </example_response>
|
| 57 |
|
| 58 | ## Useful command examples
|
| 59 |
|
| 60 | ### Create a new file:
|
| 61 |
|
| 62 | ```mswea_bash_command
|
| 63 | cat <<'EOF' > newfile.py
|
| 64 | import numpy as np
|
| 65 | hello = "world"
|
| 66 | print(hello)
|
| 67 | EOF
|
| 68 | ```
|
| 69 |
|
| 70 | ### Edit files with sed:
|
| 71 |
|
| 72 | {%- if system == "Darwin" -%}
|
| 73 | <important>
|
| 74 | You are on MacOS. For all the below examples, you need to use `sed -i ''` instead of `sed -i`.
|
| 75 | </important>
|
| 76 | {%- endif -%}
|
| 77 |
|
| 78 | ```mswea_bash_command
|
| 79 | # Replace all occurrences
|
| 80 | sed -i 's/old_string/new_string/g' filename.py
|
| 81 |
|
| 82 | # Replace only first occurrence
|
| 83 | sed -i 's/old_string/new_string/' filename.py
|
| 84 |
|
| 85 | # Replace first occurrence on line 1
|
| 86 | sed -i '1s/old_string/new_string/' filename.py
|
| 87 |
|
| 88 | # Replace all occurrences in lines 1-10
|
| 89 | sed -i '1,10s/old_string/new_string/g' filename.py
|
| 90 | ```
|
| 91 |
|
| 92 | ### View file content:
|
| 93 |
|
| 94 | ```mswea_bash_command
|
| 95 | # View specific lines with numbers
|
| 96 | nl -ba filename.py | sed -n '10,20p'
|
| 97 | ```
|
| 98 |
|
| 99 | ### Any other command you want to run
|
| 100 |
|
| 101 | ```mswea_bash_command
|
| 102 | anything
|
| 103 | ```
|
| 104 | step_limit: 0
|
| 105 | cost_limit: 3.
|
| 106 | mode: confirm
|
| 107 | environment:
|
| 108 | env:
|
| 109 | PAGER: cat
|
| 110 | MANPAGER: cat
|
| 111 | LESS: -R
|
| 112 | PIP_PROGRESS_BAR: 'off'
|
| 113 | TQDM_DISABLE: '1'
|
| 114 | model:
|
| 115 | observation_template: |
|
| 116 | {% if output.exception_info -%}
|
| 117 | <exception>{{output.exception_info}}</exception>
|
| 118 | {% endif -%}
|
| 119 | <returncode>{{output.returncode}}</returncode>
|
| 120 | {% if output.output | length < 10000 -%}
|
| 121 | <output>
|
| 122 | {{ output.output -}}
|
| 123 | </output>
|
| 124 | {%- else -%}
|
| 125 | <warning>
|
| 126 | The output of your last command was too long.
|
| 127 | Please try a different command that produces less output.
|
| 128 | If you're looking at a file you can try use head, tail or sed to view a smaller number of lines selectively.
|
| 129 | If you're using grep or find and it produced too much output, you can use a more selective search pattern.
|
| 130 | If you really need to see something from the full command's output, you can redirect output to a file and then search in that file.
|
| 131 | </warning>
|
| 132 | {%- set elided_chars = output.output | length - 10000 -%}
|
| 133 | <output_head>
|
| 134 | {{ output.output[:5000] }}
|
| 135 | </output_head>
|
| 136 | <elided_chars>
|
| 137 | {{ elided_chars }} characters elided
|
| 138 | </elided_chars>
|
| 139 | <output_tail>
|
| 140 | {{ output.output[-5000:] }}
|
| 141 | </output_tail>
|
| 142 | {%- endif -%}
|
| 143 | model_kwargs:
|
| 144 | drop_params: true
|
| 145 | format_error_template: |
|
| 146 | Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
|
| 147 |
|
| 148 | Please format your action in triple backticks as shown in <response_example>.
|
| 149 |
|
| 150 | <response_example>
|
| 151 | Here are some thoughts about why you want to perform the action.
|
| 152 |
|
| 153 | ```mswea_bash_command
|
| 154 | <action>
|
| 155 | ```
|
| 156 | </response_example>
|
| 157 |
|
| 158 | If you have completed your assignment, please consult the first message about how to
|
| 159 | submit your solution (you will not be able to continue working on this task after that).
|