Skip to content

Commit 44ac03b

Browse files
tbitcsoz-agent
andcommitted
refactor: simplify AgentConfig — effective_utility_model, unlimited iterations
- utility_model defaults to '' (empty = same as primary_model) - effective_utility_model property returns primary if utility is empty - effective_max_iterations: 0 = unlimited (maps to 999 practical ceiling) - Verifier now uses effective_utility_model instead of utility_model directly Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 1c3d019 commit 44ac03b

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/specsmith/agents/config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AgentConfig:
1414
"""Configuration for the AG2 agent shell."""
1515

1616
primary_model: str = "qwen2.5:14b"
17-
utility_model: str = "qwen2.5:14b" # same as primary; override in scaffold.yml
17+
utility_model: str = "" # empty = same as primary_model
1818
ollama_base_url: str = "http://localhost:11434"
1919
max_iterations: int = 10
2020
stream: bool = False
@@ -23,6 +23,16 @@ class AgentConfig:
2323
default_factory=lambda: ["filesystem", "shell", "git", "tests", "docs"]
2424
)
2525

26+
@property
27+
def effective_utility_model(self) -> str:
28+
"""Utility model, defaulting to primary if not set."""
29+
return self.utility_model or self.primary_model
30+
31+
@property
32+
def effective_max_iterations(self) -> int:
33+
"""0 means unlimited (use 999 as practical ceiling)."""
34+
return self.max_iterations if self.max_iterations > 0 else 999
35+
2636
def llm_config_dict(self, model: str | None = None) -> dict[str, Any]:
2737
"""Return an AG2-compatible LLM config dict for Ollama."""
2838
return {

src/specsmith/agents/roles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def create_verifier(config: AgentConfig, project_dir: str) -> Any:
172172
from specsmith.agents.tools.shell import run_project_command
173173
from specsmith.agents.tools.tests import run_unit_tests, summarize_failures
174174

175-
llm_config = LLMConfig(config.llm_config_dict(model=config.utility_model))
175+
llm_config = LLMConfig(config.llm_config_dict(model=config.effective_utility_model))
176176
pd = project_dir
177177

178178
def _run_tests(test_path: str = "tests/", extra_args: str = "--tb=short -q") -> str:

0 commit comments

Comments
 (0)