Skip to content

Commit 5eb656d

Browse files
authored
Update config.py
1 parent f9eaabb commit 5eb656d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

python_agent_harness/config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
"reasoning_effort": null,
240240
"stream": null
241241
}},
242+
"default_agent": null,
242243
"paths": {{
243244
"_comment": "Optional overrides for context and skill directories. Absolute paths or ~ expansion supported.",
244245
"context_path": null,
@@ -458,6 +459,23 @@ def load_models_config(path: str | os.PathLike | None = None) -> dict[str, dict]
458459
return profiles
459460

460461

462+
def load_default_agent(path: str | os.PathLike | None = None) -> str | None:
463+
"""Load the default agent name from the config file's ``default_agent`` key.
464+
465+
Returns the agent name (str) when set, or None when unset (meaning
466+
use the built-in ``default`` agent, i.e. ``prompts/agent.md``).
467+
"""
468+
data = _read_config(path)
469+
val = data.get("default_agent")
470+
if val is None:
471+
return None
472+
if not isinstance(val, str) or not val.strip():
473+
raise ValueError(
474+
f"config file {_config_path(path)}: default_agent must be a non-empty string"
475+
)
476+
return val.strip()
477+
478+
461479
def mask_secret(value: str | None) -> str:
462480
return "****" if value else "(unset)"
463481

0 commit comments

Comments
 (0)