diff --git a/README.md b/README.md index 78449f4..50d7dc2 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,10 @@ Python-based Telnet helper for connecting to MUD servers, handling login flows, 6. To run an agent that orchestrates several tools, use: ```text - #agent move,explore + #agent fixed move,explore ``` - This example uses the fixed-strategy agent to run `move` and then `explore` once. + This example uses the fixed strategy agent to run `move` and then `explore` once. The first token after `#agent` selects the agent type (`fixed` today, more to come), and any remaining text is passed as that agent's configuration. ## Environment Variables diff --git a/agents.py b/agents.py index 6b8a1ff..0734819 100644 --- a/agents.py +++ b/agents.py @@ -44,13 +44,9 @@ def build_agent(spec: str) -> Agent: if not normalized: raise RuntimeError("Agent specification must not be empty") - if ":" in normalized: - kind, config = normalized.split(":", 1) - else: - kind, config = "fixed", normalized - - kind = kind.strip().lower() - config = config.strip() + parts = normalized.split(maxsplit=1) + kind = parts[0].lower() + config = parts[1].strip() if len(parts) > 1 else "" if kind in {"fixed", "strategy", "fixedstrategy"}: return FixedStrategyAgent(config)