Skip to content

UI: surface AgentPlaybookRuns in the reference client stack #50

Description

@ibolton336

Context

#36 adds the AgentPlaybook / AgentPlaybookRun controllers (the CRDs are already merged). The reference client stack from #35 (contract types, hub-shim, browser UI) is AgentRun-only today. This issue tracks the client-side work to surface playbook runs end to end.

Not blocked by #46 — this work sits entirely on the CR/status surface, which stays stable while the harness decomposition changes what runs inside stage images. Can be developed against the #36 branch on a local cluster before it merges.

Tasks

  • Contract types — mirror AgentPlaybook, AgentPlaybookRun (spec + status incl. status.stages[]{name, phase, agentRunName}, currentStage) into agentrun-client types and the browser-safe agentic-client contract; add Ready-condition reason constants (PlaybookNotFound, PlaybookNotReady, StageRunning, StageSucceeded, StageFailed, StageNotFound, AgentRunCreationFailed, AgentRunDeleted, Succeeded) and label keys konveyor.io/agentplaybookrun / konveyor.io/stage. Phase reuses the AgentRun enum.
  • hub-shim routesGET /api/agentplaybooks[/:name]; GET|POST /api/agentplaybookruns, GET|DELETE /api/agentplaybookruns/:name; convenience GET /api/agentplaybookruns/:name/agentruns via the konveyor.io/agentplaybookrun label selector. On create, resolve params/models against the union of stage Agents (params forward wholesale; models apply to all stages — 400 if stages disagree on providers, since there are no per-stage overrides).
  • Client methods — extend RunApi/ShimClient with playbook list/create/get/delete + stage-run listing; delete+recreate semantics only (spec is whole-spec immutable via CEL).
  • Playbook-runs list view — columns per the CRD printer columns (Playbook, Phase, Current stage, Age) plus x/y stages; duration computed from startTime/completionTime (status has no duration field, unlike AgentRun).
  • Detail page — stage stepper from status.stages[]; each started stage links to the existing RunDetailPage/ChatPanel for its agentRunName (stage runs are ordinary AgentRuns — ACP chat works unchanged while a stage is Running). Delete copy must state cascade: stage AgentRuns are owner-referenced and GC'd.
  • Create modal — playbook picker (disable non-Ready playbooks, show AgentsNotReady message), param form from the union of stage Agents' declared params with ADR 0005 platform-resolved partitioning; no instructions field (spec has none; stage instructions come from the playbook).
  • RunsPage guard — stage-owned AgentRuns (label present) appear in the flat runs list: badge them with a link to the parent playbook run, and warn/disable Delete (deleting a stage run terminally fails the parent with AgentRunDeleted, no retry).

Contract gotchas (from #36 review)

  • Ready=False is the normal healthy state while a playbook run executes (StageRunning) — must not render as an error.
  • Never point waitForRunning/ACP resolution at the playbook run itself (it has no sandboxName/secretKeyRef); always target status.stages[].agentRunName.
  • Stage AgentRun names are <playbookrun>-<stage> but hash-truncated past 63 chars — read status.stages[].agentRunName / labels rather than recomputing.
  • Cascade deletion closes any open stage chat mid-session (WS 1011) — RunDetailPage's 404 handling covers it, ChatPanel copy should too.

Out of scope (separate issues)

Refs: #35, #36. Related: #22#24 (tackle2-ui client layer inherits this shape).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions