Skip to content

Commit ab1f815

Browse files
anticomputerCopilot
andcommitted
Document --model-config / -m CLI flag in README
- Add -m to architecture diagram CLI flags listing - Document model config persistence in session recovery section - Add CLI override subsection under Model configs with usage example Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c5289a4 commit ab1f815

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ You can find a detailed overview of the taskflow grammar [here](doc/GRAMMAR.md)
2424
```
2525
┌─────────────────────────────────────────────────────┐
2626
│ CLI (cli.py) │
27-
│ Typer-based entry point: -p, -t, -l, -g, --resume
27+
│ Typer-based entry point: -p, -t, -l, -g, -m, --resume│
2828
└─────────────────────┬───────────────────────────────┘
2929
3030
┌─────────────────────▼───────────────────────────────┐
@@ -132,6 +132,14 @@ Resume from the last successful checkpoint:
132132
python -m seclab_taskflow_agent --resume abc123def456
133133
```
134134

135+
The session checkpoint persists the CLI-provided `--model-config` value (if
136+
any), so resumes use the same model configuration by default. To override the
137+
model config on resume, pass `--model-config` / `-m` explicitly:
138+
139+
```bash
140+
python -m seclab_taskflow_agent --resume abc123def456 -m examples.model_configs.responses_api
141+
```
142+
135143
Failed tasks are automatically retried up to 3 times with increasing backoff
136144
before the session is saved. Session checkpoints are stored in the
137145
platform-specific application data directory.
@@ -611,6 +619,19 @@ taskflow:
611619

612620
The model version can then be updated by changing `gpt_latest` in the `model_config` file and applied across all taskflows that use the config.
613621

622+
#### CLI override
623+
624+
The `model_config` can also be specified (or overridden) from the command line
625+
with `--model-config` / `-m`. This takes precedence over any `model_config`
626+
value defined in the taskflow YAML:
627+
628+
```bash
629+
python -m seclab_taskflow_agent -t examples.taskflows.echo -m examples.model_configs.responses_api
630+
```
631+
632+
The CLI-provided model config is persisted in the session checkpoint, so
633+
resumed runs automatically use the same configuration.
634+
614635
In addition, model specific parameters can be provided via `model_config`. To do so, define a `model_settings` section in the `model_config` file. This section has to be a dictionary with the model names as keys:
615636

616637
```yaml

tests/test_runner.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,26 +286,24 @@ class TestCliModelConfigOverride:
286286

287287
def test_cli_overrides_taskflow_model_config(self):
288288
"""cli_model_config takes precedence over taskflow_doc.model_config_ref."""
289-
taskflow_ref = "taskflow.models.default"
290-
cli_ref = "cli.models.override"
291-
292-
# Simulate the override logic from run_main
293-
model_config_ref = taskflow_ref
294-
if cli_ref:
295-
model_config_ref = cli_ref
296-
297-
assert model_config_ref == cli_ref
289+
model_config_ref = self._resolve("taskflow.models.default", "cli.models.override")
290+
assert model_config_ref == "cli.models.override"
298291

299292
def test_taskflow_model_config_used_when_cli_absent(self):
300293
"""Taskflow model_config_ref is used when cli_model_config is None."""
301294
taskflow_ref = "taskflow.models.default"
302295
cli_ref = None
303296

297+
model_config_ref = self._resolve(taskflow_ref, cli_ref)
298+
assert model_config_ref == taskflow_ref
299+
300+
@staticmethod
301+
def _resolve(taskflow_ref: str, cli_ref: str | None) -> str:
302+
"""Reproduce the override logic from run_main."""
304303
model_config_ref = taskflow_ref
305304
if cli_ref:
306305
model_config_ref = cli_ref
307-
308-
assert model_config_ref == taskflow_ref
306+
return model_config_ref
309307

310308
def test_cli_model_config_resolves_via_available_tools(self):
311309
"""CLI-provided model config is resolved through _resolve_model_config."""

0 commit comments

Comments
 (0)