Summary
createAgentRunForStage forwards the playbook run's spec.params wholesale to every stage's AgentRun, and the AgentRun controller rejects any param the Agent doesn't declare (param %q is not declared by Agent %q). Net effect: a param needed by one stage must be declared by every stage's Agent, or that stage's AgentRun fails validation.
#36 listed "no param validation against stage Agents" as a known gap, but in practice the composition is over-strict rather than under-validated — the run-level check makes cross-stage param sets a hard requirement on Agent authors.
Concrete case (real playbook, controller @ fff23af)
Three-stage RHDH upgrade playbook (assess → remediate → validate). Assess/validate use an assessment Agent needing target_version / from_version; the remediation Agent needs neither — but had to declare both (plus the shared mode param the assessment agents needed) purely so the forwarded params pass validation. Every new stage-specific param ripples into all other stage Agents' spec.params.
The client side inherits this too: the reference-client plan (#50) has to build create-forms from the union of stage Agents' declared params.
Possible directions
- Per-stage param mapping on
AgentPlaybookStage (e.g. stage.params overriding/filtering the run-level set) — most explicit, matches Tekton's pipeline→task param wiring.
- Filter on forward: the playbook-run controller forwards only params the stage's Agent declares — zero API change, keeps existing AgentRun validation meaningful.
- Relax AgentRun validation to ignore undeclared params — simplest but weakens direct-AgentRun feedback.
(2) seems like the smallest change that removes the coupling; happy to PR it if there's agreement on direction.
Summary
createAgentRunForStageforwards the playbook run'sspec.paramswholesale to every stage's AgentRun, and the AgentRun controller rejects any param the Agent doesn't declare (param %q is not declared by Agent %q). Net effect: a param needed by one stage must be declared by every stage's Agent, or that stage's AgentRun fails validation.#36 listed "no param validation against stage Agents" as a known gap, but in practice the composition is over-strict rather than under-validated — the run-level check makes cross-stage param sets a hard requirement on Agent authors.
Concrete case (real playbook, controller @ fff23af)
Three-stage RHDH upgrade playbook (assess → remediate → validate). Assess/validate use an assessment Agent needing
target_version/from_version; the remediation Agent needs neither — but had to declare both (plus the sharedmodeparam the assessment agents needed) purely so the forwarded params pass validation. Every new stage-specific param ripples into all other stage Agents'spec.params.The client side inherits this too: the reference-client plan (#50) has to build create-forms from the union of stage Agents' declared params.
Possible directions
AgentPlaybookStage(e.g.stage.paramsoverriding/filtering the run-level set) — most explicit, matches Tekton's pipeline→task param wiring.(2) seems like the smallest change that removes the coupling; happy to PR it if there's agreement on direction.