File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
461479def mask_secret (value : str | None ) -> str :
462480 return "****" if value else "(unset)"
463481
You can’t perform that action at this time.
0 commit comments