Skip to content

Commit 4c707b3

Browse files
fix(config): remove default.yaml, which paired text prompts with the tool-call model
default.yaml told the model to answer in mswea_bash_command text blocks and repeated that guidance in its format_error_template, but the default model class only parses native tool calls, so a model that followed the prompts could only loop through format errors into RepeatedFormatError. hello_world.py (the only runtime consumer) now loads mini.yaml; tests that used default.yaml as their text-format agent config now load mini_textbased.yaml.
1 parent e187bcb commit 4c707b3

7 files changed

Lines changed: 18 additions & 191 deletions

File tree

src/minisweagent/config/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Configs
22

33
* `mini.yaml` - Default config for `mini`/`agents/interactive.py` agent.
4-
* `default.yaml` - Default config for the `default.py` agent.
54

65
## Benchmarks
76

src/minisweagent/config/default.yaml

Lines changed: 0 additions & 171 deletions
This file was deleted.

src/minisweagent/run/hello_world.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def main(
3232
agent = DefaultAgent(
3333
LitellmModel(model_name=model_name),
3434
LocalEnvironment(),
35-
**yaml.safe_load(Path(package_dir / "config" / "default.yaml").read_text())["agent"],
35+
**yaml.safe_load(Path(package_dir / "config" / "mini.yaml").read_text())["agent"],
3636
)
3737
agent.run(task)
3838
return agent

tests/agents/test_default.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def is_observation_message(msg: dict) -> bool:
5757

5858

5959
@pytest.fixture
60-
def default_config():
61-
"""Load default agent config from config/default.yaml"""
62-
config_path = Path("src/minisweagent/config/default.yaml")
60+
def textbased_config():
61+
"""Load text-based agent config from config/mini_textbased.yaml"""
62+
config_path = Path("src/minisweagent/config/mini_textbased.yaml")
6363
with open(config_path) as f:
6464
config = yaml.safe_load(f)
6565
return config["agent"]
@@ -114,10 +114,10 @@ def make_response_api_model(
114114

115115

116116
@pytest.fixture(params=["text", "toolcall", "response_api"])
117-
def model_factory(request, default_config, toolcall_config):
117+
def model_factory(request, textbased_config, toolcall_config):
118118
"""Parametrized fixture that returns (factory_fn, config) for all three model types."""
119119
if request.param == "text":
120-
return make_text_model, default_config
120+
return make_text_model, textbased_config
121121
elif request.param == "toolcall":
122122
return make_tc_model, toolcall_config
123123
else: # response_api

tests/agents/test_interactive.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def _make_model(outputs: list[tuple[str, list[dict]]], **kwargs) -> Deterministi
102102

103103

104104
@pytest.fixture
105-
def default_config():
106-
"""Load default agent config from config/default.yaml"""
107-
config_path = Path("src/minisweagent/config/default.yaml")
105+
def textbased_config():
106+
"""Load text-based agent config from config/mini_textbased.yaml"""
107+
config_path = Path("src/minisweagent/config/mini_textbased.yaml")
108108
with open(config_path) as f:
109109
config = yaml.safe_load(f)
110110
return config["agent"]
@@ -120,10 +120,10 @@ def toolcall_config():
120120

121121

122122
@pytest.fixture(params=["text", "toolcall", "response_api"])
123-
def model_factory(request, default_config, toolcall_config):
123+
def model_factory(request, textbased_config, toolcall_config):
124124
"""Parametrized fixture that returns (factory_fn, config) for all three model types."""
125125
if request.param == "text":
126-
return make_text_model, default_config
126+
return make_text_model, textbased_config
127127
elif request.param == "toolcall":
128128
return make_tc_model, toolcall_config
129129
else: # response_api

tests/run/test_cli_integration.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ def test_output_file_is_created(tmp_path):
568568

569569
# Create a temporary config file
570570
config_file = tmp_path / "test_config.yaml"
571-
default_config_path = Path("src/minisweagent/config/default.yaml")
572-
config_file.write_text(default_config_path.read_text())
571+
config_file.write_text(Path("src/minisweagent/config/mini_textbased.yaml").read_text())
573572

574573
with (
575574
patch("minisweagent.run.mini.configure_if_first_time"),

tests/run/test_save.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def test_agent_save_includes_class_names():
1111
"""Test that agent.save includes the full class names with import paths."""
1212
import yaml
1313

14-
config_path = Path("src/minisweagent/config/default.yaml")
14+
config_path = Path("src/minisweagent/config/mini_textbased.yaml")
1515
with open(config_path) as f:
16-
default_config = yaml.safe_load(f)["agent"]
16+
agent_config = yaml.safe_load(f)["agent"]
1717

1818
model = DeterministicModel(outputs=[make_output("echo 'test'", [])])
1919
env = LocalEnvironment()
20-
agent = DefaultAgent(model, env, **default_config)
20+
agent = DefaultAgent(model, env, **agent_config)
2121

2222
agent.add_messages({"role": "system", "content": "test system message"})
2323
agent.add_messages({"role": "user", "content": "test user message"})
@@ -52,13 +52,13 @@ def test_agent_serialize():
5252
"""Test that agent.serialize returns the correct structure."""
5353
import yaml
5454

55-
config_path = Path("src/minisweagent/config/default.yaml")
55+
config_path = Path("src/minisweagent/config/mini_textbased.yaml")
5656
with open(config_path) as f:
57-
default_config = yaml.safe_load(f)["agent"]
57+
agent_config = yaml.safe_load(f)["agent"]
5858

5959
model = DeterministicModel(outputs=[make_output("echo 'test'", [])])
6060
env = LocalEnvironment()
61-
agent = DefaultAgent(model, env, **default_config)
61+
agent = DefaultAgent(model, env, **agent_config)
6262

6363
agent.add_messages({"role": "system", "content": "test system message"})
6464
agent.add_messages({"role": "user", "content": "test user message"})

0 commit comments

Comments
 (0)