Build a standard agent args namespace with YAML config fallback applied.
(
workflow_file: str,
model: str | None = None,
output_dir: str | None = None,
mcp_url: str | None = None,
resume: bool = False,
)
| 158 | |
| 159 | |
| 160 | def build_agent_args( |
| 161 | workflow_file: str, |
| 162 | model: str | None = None, |
| 163 | output_dir: str | None = None, |
| 164 | mcp_url: str | None = None, |
| 165 | resume: bool = False, |
| 166 | ) -> types.SimpleNamespace: |
| 167 | """Build a standard agent args namespace with YAML config fallback applied.""" |
| 168 | yaml_config = load_yaml_config(workflow_file) |
| 169 | args = types.SimpleNamespace( |
| 170 | workflow_file=workflow_file, |
| 171 | mode="simple", |
| 172 | model=model, |
| 173 | max_tokens_per_step=None, |
| 174 | max_tool_calls_per_step=None, |
| 175 | temperature=None, |
| 176 | plan_revision_max_steps=None, |
| 177 | model_kwargs=None, |
| 178 | output_dir=output_dir, |
| 179 | resume=resume, |
| 180 | checkpoint_path=None, |
| 181 | trace_path=None, |
| 182 | replay_trace=None, |
| 183 | mcp_url=mcp_url, |
| 184 | ) |
| 185 | apply_yaml_config_fallback(args, yaml_config) |
| 186 | return args |
| 187 | |
| 188 | |
| 189 | def run_ephemeral( |
no test coverage detected