mini-swe-agent v2.0 brings native tool calling, multimodal input support, and a cleaner architecture where models own action parsing and observation formatting. Most of these improvements required breaking changes to the config format, Python APIs, and trajectory structure. This guide covers every change you need to make.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/swe-agent/mini-swe-agent/llms.txt
Use this file to discover all available pages before exploring further.
What changed at a glance
| Area | Impact |
|---|---|
| CLI with default configs | No changes needed |
| Custom YAML configs | Config keys moved; see Config changes |
| Trajectory parsing | Some metadata moved to extra; see Trajectory format |
| Python bindings / subclasses | Refactoring required; see Architecture changes |
Config changes
If you only customisedsystem_template and instance_template, no changes are needed.
Keys moved from agent to model:
observation_template(also renamed fromaction_observation_template)format_error_templateaction_regex(text-based parsing only)
timeout_template
```bash to ```mswea_bash_command to avoid false matches against bash examples in prompts. Update any custom prompt templates or action_regex values accordingly.
Completion signal changed:
Migration steps
Update your config files
Move
observation_template, format_error_template, and action_regex from the agent section to the model section. Remove timeout_template. Rename action_observation_template to observation_template.Update the completion signal
Replace every occurrence of
MINI_SWE_AGENT_FINAL_OUTPUT with COMPLETE_TASK_AND_SUBMIT_FINAL_OUTPUT in your prompt templates and custom environment scripts.Update the action code block tag
If you use text-based parsing, update any
action_regex patterns and prompt templates that expect ```bash to use ```mswea_bash_command instead (or set action_regex explicitly).Switch model class
Tool calling is now the default. If you were using the
anthropic model class (removed in v2), switch to litellm. If you were using litellm_response_api or portkey_response_api, rename them — see the table in Removed & renamed.Update Python imports for exceptions
Move all exception imports from
minisweagent.agents.default to minisweagent.exceptions.Update trajectory parsing code
Metadata fields that were top-level message attributes in v1 have moved into the
extra field in v2. The exact message structure now mirrors the model’s native output. See Trajectory format for details.Refactor custom Model / Environment / Agent subclasses
Review the updated protocol signatures in Architecture changes and update method signatures, removed attributes, and new required methods.
Tool calling
v2.0 uses native tool calling by default instead of regex-based text parsing.| Mode | How it works |
|---|---|
| Tool calling (default) | Model invokes a native “bash” tool via the tool-calling API |
| Text-based (legacy) | Model outputs commands in markdown code blocks; regex extracts them |
Trajectory format
- v1: All messages had
content: strandrole: str. - v2: Messages reflect the model’s native output. For standard
/completionendpoints this is still{role, content}, but for the OpenAI/responseendpoint the shape may differ.
Removed & renamed
Removed features:- Visual UI (
mini -v): The alternate textual UI has been removed. - Rotating API keys:
ANTHROPIC_API_KEYSwith::separator is no longer supported. Use a singleANTHROPIC_API_KEY. github_issuerun script: Use theminiCLI instead.MSWEA_MODEL_API_KEYenvironment variable: No longer used to override API keys.
anthropic— uselitellmfor Anthropic models (enable cache control in your config).
| v1 name | v2 name |
|---|---|
litellm_response_api | litellm_response |
portkey_response_api | portkey_response |
| Name | Description |
|---|---|
litellm_textbased | Text-based parsing (regex) instead of tool calls |
openrouter_textbased | Text-based parsing for OpenRouter |
openrouter_response | OpenRouter with response API |
swerex_modal— run environments on Modal (requirespip install mini-swe-agent[modal]).
| v1 | v2 replacement |
|---|---|
NonTerminatingException | InterruptAgentFlow base class |
TerminatingException | InterruptAgentFlow base class |
ExecutionTimeoutError | Removed (no longer used) |
Architecture changes
Responsibility shift
In v2, models own action parsing and observation formatting. This is what enables switching between tool calling and text-based parsing simply by changing themodel_class config value. The Agent class is now a simpler coordinator.
Pydantic configs
AgentConfig (and other config classes) changed from dataclass to Pydantic BaseModel. This requires pydantic >= 2.0.
Stateless models
Cost tracking moved fromModel to Agent. The cost and n_calls attributes were removed from the Model protocol.
Protocol changes
mini-swe-agent uses duck typing with protocols — you do not need to subclass anything; you only need to implement the required methods. Model protocol — changes:Exception hierarchy
All flow control exceptions now inherit fromInterruptAgentFlow and live in minisweagent.exceptions: