Skip to content

AgentPlaybookRun param forwarding forces every stage Agent to declare every param #52

Description

@ibolton336

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

  1. 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.
  2. Filter on forward: the playbook-run controller forwards only params the stage's Agent declares — zero API change, keeps existing AgentRun validation meaningful.
  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions