# Mini-swe-agent configuration for SWE-bench with Kodit retrieval
# The problem statement will be augmented with Kodit-retrieved context before running
agent:
system_template: |
You are a helpful assistant that can interact with a computer.
Your response must contain exactly ONE bash code block with ONE command (or commands connected with && or ||).
Include a THOUGHT section before your command where you explain your reasoning process.
Format your response as shown in <format_example>.
<format_example>
Your reasoning and analysis here. Explain why you want to perform the action.
```bash
your_command_here
```
</format_example>
Failure to follow these rules will cause your response to be rejected.
instance_template: |
{{task}}
You can execute bash commands and edit files to implement the necessary changes.
## Recommended Workflow
This workflow should be done step-by-step so that you can iterate on your changes and any possible problems.
1. **Start with the provided code context above** - relevant code snippets have been pre-retrieved for you. Examine them carefully to understand the codebase structure and identify the files you need to modify.
2. Read the full content of the relevant files identified from the context
3. Create a script to reproduce the issue
4. Edit the source code to resolve the issue
5. Verify your fix works by running your script again
6. Test edge cases to ensure your fix is robust
7. Submit your changes by running: `(echo "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT" && git diff)`
<important>After this command, you cannot continue working on this task.</important>
## Important Rules
1. Every response must contain exactly one action
2. The action must be enclosed in triple backticks
3. Directory or environment variable changes are not persistent. Every action is executed in a new subshell.
However, you can prefix any action with `MY_ENV_VAR=MY_VALUE cd /path/to/working/dir && ...` or write/load environment variables from files
## Formatting your response
Here is an example of a correct response:
<example_response>
THOUGHT: Based on the provided code context, I can see the relevant file is src/flask/blueprints.py. Let me read the full file to understand the implementation.
```bash
cat /testbed/src/flask/blueprints.py
```
</example_response>
## Useful command examples
### Create a new file:
```bash
cat <<'EOF' > newfile.py
import numpy as np
hello = "world"
print(hello)
EOF
```
### Edit files with sed:
```bash
# Replace all occurrences
sed -i 's/old_string/new_string/g' filename.py
# Replace only first occurrence
sed -i 's/old_string/new_string/' filename.py
# Replace first occurrence on line 1
sed -i '1s/old_string/new_string/' filename.py
# Replace all occurrences in lines 1-10
sed -i '1,10s/old_string/new_string/g' filename.py
```
### View file content:
```bash
# View specific lines with numbers
nl -ba filename.py | sed -n '10,20p'
```
### Any other command you want to run
```bash
anything
```
action_observation_template: |
<returncode>{{output.returncode}}</returncode>
{% if output.output | length < 10000 -%}
<output>
{{ output.output -}}
</output>
{%- else -%}
<warning>
The output of your last command was too long.
Please try a different command that produces less output.
If you're looking at a file you can try use head, tail or sed to view a smaller number of lines selectively.
If you're using grep or find and it produced too much output, you can use a more selective search pattern.
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.
</warning>
{%- set elided_chars = output.output | length - 10000 -%}
<output_head>
{{ output.output[:5000] }}
</output_head>
<elided_chars>
{{ elided_chars }} characters elided
</elided_chars>
<output_tail>
{{ output.output[-5000:] }}
</output_tail>
{%- endif -%}
format_error_template: |
Please always provide EXACTLY ONE action in triple backticks, found {{actions|length}} actions.
If you want to end the task, please issue the following command: `(echo "COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT" && git diff)`
Else, please format your response exactly as follows:
<response_example>
Here are some thoughts about why you want to perform the action.
```bash
<action>
```
</response_example>
Note: In rare cases, if you need to reference a similar format in your command, you might have
to proceed in two steps, first writing TRIPLEBACKTICKSBASH, then replacing them with ```bash.
timeout_template: |
The last command <command>{{action['action']}}</command> timed out and has been killed.
The output of the command was:
{% if output | length < 10000 -%}
<output>
{{output}}
</output>
{%- else -%}
<warning>Output was too long and has been truncated.</warning>
<output_head>
{{ output[:5000] }}
</output_head>
<elided_chars>{{ output | length - 10000 }} characters elided</elided_chars>
<output_tail>
{{ output[-5000:] }}
</output_tail>
{%- endif %}
Please try another command and make sure to avoid those requiring interactive input.
step_limit: 0.
cost_limit: 0.
environment:
env:
PAGER: cat
MANPAGER: cat
LESS: -R
PIP_PROGRESS_BAR: "off"
TQDM_DISABLE: "1"
model:
model_name: openrouter/anthropic/claude-haiku-4.5
model_kwargs:
drop_params: true