Allow launching runs with whole-run and per-stage model overrides
Add `pipelines run --model PROVIDER/MODEL` and repeatable `--stage-model STAGE=PROVIDER/MODEL`, resolved with precedence per-stage > whole-run > the model pinned in the pipeline version. - A shared pure resolver (`pipeline.ParseModelOverride` / `pipeline.EffectiveModels`) owns the precedence and validation: every value must be a `provider/model` pair (`stage.ValidModel`), every stage key must exist in the pinned graph, an unknown key fails naming the valid keys, and a per-stage key that names a non-model stage is refused. - The server validates against the pinned version before admission (no run row is ever inserted for an invalid request), persists `model`/`stage_models` on the run and `provider`/`model` on each step, applies the effective pair to a clone of the stage definition so the stage and its repair/formatter path share it, overlays the returned run graph with the effective pair (presentation only), and reuses the recorded overrides on retry. - The run record echoes the overrides it was launched with and each step records the provider/model it actually ran with; the TUI Evidence pane renders that effective pair. The pinned pipeline version and `show --version N` are never modified. - CLI help, `docs/cli.md` and the packaged authoring skill references document the flags and the precedence. A TUI override picker remains a documented follow-up; the CLI is the deliverable. Tests: pure precedence/validation table tests, store round-trip and request-key-mismatch plus migration, server admission/application/overlay/retry with a controlled executor, CLI flag/help/malformed-value tests, and a TUI evidence test.
This commit is contained in:
@@ -126,6 +126,13 @@ Adapt the scope and publishing lines per item; keep the rest.
|
||||
- Launch with the authoritative `CLI_PREFIX` (`pipelines run`). The brief text is the
|
||||
run's task; pass it whole. Read `references/operations.md` for the exact flags —
|
||||
`--json`, confirmation (`--yes`) and `--wait`/`--wait-timeout`.
|
||||
- **Model overrides at launch.** Use `--model PROVIDER/MODEL` to override the model
|
||||
for every model stage of that run, and repeatable `--stage-model
|
||||
STAGE=PROVIDER/MODEL` to override individual stages. Precedence is per-stage >
|
||||
whole-run > the model pinned in the pipeline version. Overrides apply to that run
|
||||
only (the pinned pipeline is never edited), are validated before the run starts,
|
||||
and are recorded on the run; `retry` reuses them. See `references/harnesses.md`
|
||||
for how a stage's model and its repair path both use the effective model.
|
||||
- Watch to a **terminal state** (`succeeded`, `failed`, `canceled`, `interrupted`).
|
||||
Poll `CLI_PREFIX inspect RUN_ID --json` (or use `--wait`) until terminal. A reached
|
||||
client wait limit is not a run failure: the run stays active; keep waiting or
|
||||
|
||||
Reference in New Issue
Block a user