Skip to content

⚠️ Rename AgentPlaybook to AgentWorkflow; fix stage bugs - #80

Merged
djzager merged 1 commit into
konveyor:mainfrom
djzager:agentworkflow-rename
Aug 3, 2026
Merged

djzager merged 1 commit into
konveyor:mainfrom
djzager:agentworkflow-rename

Conversation

@djzager

@djzager djzager commented Jul 31, 2026

Copy link
Copy Markdown
Member

Rename AgentPlaybook/AgentPlaybookRun to AgentWorkflow/AgentWorkflowRun across CRD types, controllers, tests, CRD manifests, RBAC, docs, and changelog fragments. KONVEYOR_PLAYBOOK_INSTRUCTIONS renamed to KONVEYOR_WORKFLOW_GUIDE. Short names updated: ap->aw, apr->awr.

Fix #51: Change AgentRun sandbox restartPolicy from OnFailure to Never so that failed stages reach a terminal phase instead of crashlooping indefinitely.

Fix #52: Filter workflow-run params to only those the stage Agent declares. The controller looks up the stage Agent and forwards only matching params, removing the coupling that forced every stage Agent to declare every param from other stages.

Add stage metadata env vars (#68): inject KONVEYOR_WORKFLOW_STAGE and KONVEYOR_WORKFLOW_STAGE_COUNT into each child AgentRun. The harness uses these for stage-aware token revocation (revoke only on last stage).

Closes #63
Fixes #51
Fixes #52
Refs #68

Summary by CodeRabbit

  • New Features

    • Introduced AgentWorkflow and AgentWorkflowRun resources for sequential, multi-stage agent orchestration.
    • Workflow runs now pass stage metadata and workflow guidance to each stage.
    • Stage parameters are limited to those declared by the relevant agent.
  • Breaking Changes

    • Replaced AgentPlaybook resources and terminology with AgentWorkflow.
    • Updated run references from playbookRef to workflowRef.
  • Bug Fixes

    • Prevented parameters from unintentionally carrying across workflow stages.
    • Sandbox pods now use a non-restarting policy, allowing failures to reach a terminal state.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@djzager, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 6 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b1410fa-1e33-4b69-af36-775f22518e1d

📥 Commits

Reviewing files that changed from the base of the PR and between 3d3e9fc and ff33bf5.

📒 Files selected for processing (32)
  • AGENTS.md
  • README.md
  • api/v1alpha1/agentworkflow_types.go
  • api/v1alpha1/agentworkflowrun_types.go
  • api/v1alpha1/groupversion_info.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • changes/unreleased/agentplaybook-controllers.yaml
  • changes/unreleased/agentworkflow-controllers.yaml
  • changes/unreleased/scaffold-crds.yaml
  • cmd/main.go
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • config/crd/kustomization.yaml
  • config/rbac/role.yaml
  • docs/adr/0001-agentic-platform-crd-architecture.md
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • docs/adr/0007-harness-thin-runner-and-skillcard-skills.md
  • docs/slides/demo-2026-07-16.md
  • hack/harness-test/resources.yaml
  • hack/harness-test/workflow-resources.yaml
  • harness/README.md
  • harness/internal/config/config.go
  • harness/internal/config/config_test.go
  • internal/controller/agentrun_controller.go
  • internal/controller/agentrun_controller_test.go
  • internal/controller/agentworkflow_controller.go
  • internal/controller/agentworkflow_controller_test.go
  • internal/controller/agentworkflowrun_controller.go
  • internal/controller/agentworkflowrun_controller_test.go
  • internal/controller/crd_validation_test.go
  • internal/controller/doc.go
  • internal/controller/suite_test.go
📝 Walkthrough

Walkthrough

The PR renames AgentPlaybook resources and APIs to AgentWorkflow resources. It updates controller orchestration, parameter forwarding, stage metadata, Sandbox restart behavior, Kubernetes manifests, tests, wiring, harness references, and documentation.

Changes

AgentWorkflow resource migration

Layer / File(s) Summary
Workflow API contracts and Kubernetes resources
api/v1alpha1/*, config/crd/*, config/rbac/role.yaml
Renamed workflow and workflow-run types, fields, resource names, short names, schemas, generated deepcopy methods, Kustomize entries, and RBAC permissions.
Workflow reconciliation and stage execution
internal/controller/agentworkflow*_controller.go, internal/controller/agentrun_controller.go, changes/unreleased/agentworkflow-controllers.yaml
Updated reconciliation to use workflows, filter parameters per stage Agent, inject workflow and stage metadata, emit parameter-filtering events, and use non-restarting Sandbox pods.
Controller registration and validation coverage
cmd/main.go, internal/controller/*_test.go, internal/controller/doc.go, internal/controller/suite_test.go
Registered the renamed reconcilers and migrated readiness, sequential execution, failure, label, cleanup, and CRD validation tests.
Documentation and harness metadata
AGENTS.md, README.md, docs/adr/*, docs/slides/*, harness/*, hack/harness-test/*, changes/unreleased/scaffold-crds.yaml
Replaced AgentPlaybook terminology with AgentWorkflow terminology across documentation, harness references, test manifests, and changelog descriptions.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: savitharaghunathan

Sequence Diagram(s)

sequenceDiagram
  participant AgentWorkflowRunReconciler
  participant AgentWorkflow
  participant AgentRun
  participant Sandbox
  AgentWorkflowRunReconciler->>AgentWorkflow: fetch workflow and check readiness
  AgentWorkflowRunReconciler->>AgentRun: create stage run with filtered parameters and metadata
  AgentRun->>Sandbox: execute stage pod
  Sandbox-->>AgentWorkflowRunReconciler: report stage result
  AgentWorkflowRunReconciler->>AgentRun: start the next stage after success
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR adds stage metadata environment variables and harness token-revocation behavior for #68, which is outside the three linked issues. Link issue #68 to this PR or move the stage metadata and token-revocation changes into a separate PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary rename and related stage fixes, and it uses the required warning alias.
Description check ✅ Passed The description explains the rename, bug fixes, parameter filtering, stage metadata, and issue references; the required changelog fragment is present.
Linked Issues check ✅ Passed The changes satisfy #51 with restartPolicy Never, #52 with per-Agent parameter filtering, and #63 with the AgentWorkflow rename.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
internal/controller/agentrun_controller.go (1)

371-371: 🩺 Stability & Availability | 🔵 Trivial

Confirm no other layer relied on pod-level restarts for transient failures.

RestartPolicyNever correctly lets a failed stage reach a terminal state instead of crash-looping forever, per the PR objective. This also removes any automatic retry for transient container failures (e.g., a brief node hiccup), since the kubelet will no longer restart the container at all.

Confirm this tradeoff is intentional and that no bounded retry/backoff was expected at the pod level for the agent container.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/agentrun_controller.go` at line 371, Review the pod
configuration in the agent-run creation flow around RestartPolicy and confirm
that RestartPolicyNever is intentional: failed stages must reach a terminal
state without kubelet restarts. Verify no other layer depends on pod-level
restarts for transient agent-container failures and that no bounded retry or
backoff is required; adjust the restart configuration only if that review
identifies an expected retry policy.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Around line 7-10: Update the CRD inventory in AGENTS.md to include
AgentWorkflowRun alongside Agent, AgentRun, AgentWorkflow, SkillCard,
SkillCollection, and LLMProvider, so the documentation lists all seven resources
consistently with the project documentation.

In `@internal/controller/agentworkflowrun_controller.go`:
- Around line 297-363: Update createAgentRunForStage so user-supplied
pbRun.Spec.Env entries are appended before the controller-injected
KONVEYOR_WORKFLOW_STAGE and KONVEYOR_WORKFLOW_STAGE_COUNT variables. Ensure the
controller-owned metadata remains the final value for duplicate names,
preserving user env entries while preventing overrides.

---

Nitpick comments:
In `@internal/controller/agentrun_controller.go`:
- Line 371: Review the pod configuration in the agent-run creation flow around
RestartPolicy and confirm that RestartPolicyNever is intentional: failed stages
must reach a terminal state without kubelet restarts. Verify no other layer
depends on pod-level restarts for transient agent-container failures and that no
bounded retry or backoff is required; adjust the restart configuration only if
that review identifies an expected retry policy.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c6dbd78-ff1a-464e-b4e8-acfbd471ec5b

📥 Commits

Reviewing files that changed from the base of the PR and between 852c6a7 and 9bc828a.

📒 Files selected for processing (25)
  • AGENTS.md
  • README.md
  • api/v1alpha1/agentworkflow_types.go
  • api/v1alpha1/agentworkflowrun_types.go
  • api/v1alpha1/groupversion_info.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • changes/unreleased/agentplaybook-controllers.yaml
  • changes/unreleased/agentworkflow-controllers.yaml
  • changes/unreleased/scaffold-crds.yaml
  • cmd/main.go
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • config/crd/kustomization.yaml
  • config/rbac/role.yaml
  • docs/adr/0001-agentic-platform-crd-architecture.md
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • docs/slides/demo-2026-07-16.md
  • internal/controller/agentrun_controller.go
  • internal/controller/agentworkflow_controller.go
  • internal/controller/agentworkflow_controller_test.go
  • internal/controller/agentworkflowrun_controller.go
  • internal/controller/agentworkflowrun_controller_test.go
  • internal/controller/crd_validation_test.go
  • internal/controller/doc.go
  • internal/controller/suite_test.go
💤 Files with no reviewable changes (1)
  • changes/unreleased/agentplaybook-controllers.yaml

Comment thread AGENTS.md
Comment thread internal/controller/agentworkflowrun_controller.go
Comment thread internal/controller/agentworkflowrun_controller.go Outdated
Comment thread AGENTS.md Outdated
Comment thread internal/controller/agentrun_controller.go
@fabianvf

Copy link
Copy Markdown
Contributor

PROJECT still lists kind: AgentPlaybook and kind: AgentPlaybookRun (lines 57 and 65). Nothing in the repo reads it as far as I can tell, so it's not breaking anything, but it's the kubebuilder project manifest so it'd be misleading for anyone running the CLI against this repo. Should we update it while we're renaming everything else?

@fabianvf

Copy link
Copy Markdown
Contributor

On agentworkflowrun_controller_test.go:167 (couldn't inline it, the line falls between diff hunks):

This exercises the pass-through path but not the filtering. There's one Agent declaring one param, both stages use it, and the run supplies exactly that param, so nothing ever gets dropped. If you swapped the new logic back to Params: pbRun.Spec.Params this test would still pass.

Should we add a second Agent declaring a different param set? That's the actual #52 scenario, where assess needs target_version and remediate needs neither.

fabianvf added a commit to fabianvf/agentic-controller that referenced this pull request Jul 31, 2026
Rename the config fields to say what they are: AgentPrompt, WorkflowGuide,
StageInstructions. cfg.Instructions was ambiguous next to the model and
provider fields.

Read KONVEYOR_WORKFLOW_GUIDE, falling back to KONVEYOR_PLAYBOOK_INSTRUCTIONS.
konveyor#80 renames the variable; reading both means the harness works either side of
that merge rather than depending on merge order. Drop the fallback once konveyor#80 has
landed everywhere.

Correct the staging rules: the harness commits .gitignore and
.konveyor/analysis.json itself, so "you decide what gets committed" overstated
the agent's control.

Rename the ## Migration Context header to ## Workflow Guide. The prompt package
is general purpose and shouldn't hardcode migration.

Always end the prompt with exactly one newline. Sections appended "\n\n" but
StageTask appended nothing, so the ending varied with whether a stage task was
set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>
@djzager
djzager force-pushed the agentworkflow-rename branch from 9bc828a to 3a1a5ae Compare August 3, 2026 14:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/controller/agentworkflowrun_controller_test.go (1)

104-145: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Test parameter filtering with different stage Agents.

Both stages use agentName, and that Agent declares testParamName. This test passes if the controller forwards every workflow-run parameter to every child AgentRun.

Create a second Agent with a different declared parameter. Supply both parameters in the AgentWorkflowRun. Assert that each stage AgentRun.Spec.Params contains only the parameter declared by its referenced Agent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/agentworkflowrun_controller_test.go` around lines 104 -
145, Update the test setup around the two-stage AgentWorkflow and
AgentWorkflowRun to create a second Ready Agent with a distinct declared
parameter, reference each Agent from a different stage, and provide both
parameters in the workflow run. Extend the assertions for each generated
AgentRun so Spec.Params contains only the parameter declared by that stage’s
referenced Agent, preserving the existing per-stage execution checks.
🧹 Nitpick comments (2)
internal/controller/agentworkflowrun_controller.go (2)

64-75: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Rename pbRun to match the AgentWorkflowRun terminology.

The variable and parameter name pbRun ("playbook run") remains throughout this file, including in Reconcile, findCurrentStageIndex, createAgentRunForStage, patchRunStatus, and stageAgentRunName. The PR's stated purpose is to remove the "Playbook" terminology. Retaining pbRun as the primary identifier for AgentWorkflowRun undermines that goal and can confuse future maintainers who expect the new domain terms.

Rename pbRun to something like wfRun across the file.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/agentworkflowrun_controller.go` around lines 64 - 75,
Rename the AgentWorkflowRun variable currently named pbRun to wfRun throughout
the file, including Reconcile, findCurrentStageIndex, createAgentRunForStage,
patchRunStatus, and stageAgentRunName, updating all references consistently
while preserving behavior.

50-54: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Add the Agent RBAC marker to AgentWorkflowRunReconciler.

createAgentRunForStage calls r.Get(ctx, ..., &agent) for konveyoriov1alpha1.Agent, but AgentWorkflowRunReconciler does not declare a konveyor.io/agents get permission. AgentReconciler already grants broader agents permissions, and config/rbac/role.yaml already includes agents, so existing deployments do not break. Add // +kubebuilder:rbac:groups=konveyor.io,resources=agents,verbs=get here for standard controller-local RBAC documentation and future controller independence.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/controller/agentworkflowrun_controller.go` around lines 50 - 54, Add
the kubebuilder RBAC marker for the AgentWorkflowRunReconciler, granting the
konveyor.io agents resource get verb. Place it alongside the existing RBAC
markers near the agentworkflows and agentruns permissions, without changing the
reconciler logic or broader permissions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/agentworkflowrun_controller.go`:
- Around line 339-367: Move the controller-owned KONVEYOR_WORKFLOW_GUIDE append
in the workflow environment construction to after pbRun.Spec.Env is appended,
while preserving the existing conditional on workflow.Spec.Guide. Keep it
alongside the stage metadata injection so user-supplied Env entries cannot
override the workflow-authored Guide.

---

Outside diff comments:
In `@internal/controller/agentworkflowrun_controller_test.go`:
- Around line 104-145: Update the test setup around the two-stage AgentWorkflow
and AgentWorkflowRun to create a second Ready Agent with a distinct declared
parameter, reference each Agent from a different stage, and provide both
parameters in the workflow run. Extend the assertions for each generated
AgentRun so Spec.Params contains only the parameter declared by that stage’s
referenced Agent, preserving the existing per-stage execution checks.

---

Nitpick comments:
In `@internal/controller/agentworkflowrun_controller.go`:
- Around line 64-75: Rename the AgentWorkflowRun variable currently named pbRun
to wfRun throughout the file, including Reconcile, findCurrentStageIndex,
createAgentRunForStage, patchRunStatus, and stageAgentRunName, updating all
references consistently while preserving behavior.
- Around line 50-54: Add the kubebuilder RBAC marker for the
AgentWorkflowRunReconciler, granting the konveyor.io agents resource get verb.
Place it alongside the existing RBAC markers near the agentworkflows and
agentruns permissions, without changing the reconciler logic or broader
permissions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 22fe657d-cd93-44e7-9adf-1036de94c880

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc828a and 3a1a5ae.

📒 Files selected for processing (26)
  • AGENTS.md
  • README.md
  • api/v1alpha1/agentworkflow_types.go
  • api/v1alpha1/agentworkflowrun_types.go
  • api/v1alpha1/groupversion_info.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • changes/unreleased/agentplaybook-controllers.yaml
  • changes/unreleased/agentworkflow-controllers.yaml
  • changes/unreleased/scaffold-crds.yaml
  • cmd/main.go
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • config/crd/kustomization.yaml
  • config/rbac/role.yaml
  • docs/adr/0001-agentic-platform-crd-architecture.md
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • docs/slides/demo-2026-07-16.md
  • internal/controller/agentrun_controller.go
  • internal/controller/agentrun_controller_test.go
  • internal/controller/agentworkflow_controller.go
  • internal/controller/agentworkflow_controller_test.go
  • internal/controller/agentworkflowrun_controller.go
  • internal/controller/agentworkflowrun_controller_test.go
  • internal/controller/crd_validation_test.go
  • internal/controller/doc.go
  • internal/controller/suite_test.go
💤 Files with no reviewable changes (1)
  • changes/unreleased/agentplaybook-controllers.yaml
🚧 Files skipped from review as they are similar to previous changes (22)
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • cmd/main.go
  • config/rbac/role.yaml
  • internal/controller/agentrun_controller.go
  • changes/unreleased/agentworkflow-controllers.yaml
  • docs/adr/0001-agentic-platform-crd-architecture.md
  • config/crd/kustomization.yaml
  • docs/slides/demo-2026-07-16.md
  • internal/controller/crd_validation_test.go
  • changes/unreleased/scaffold-crds.yaml
  • AGENTS.md
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • internal/controller/agentworkflow_controller_test.go
  • internal/controller/doc.go
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • internal/controller/agentworkflow_controller.go
  • api/v1alpha1/groupversion_info.go
  • internal/controller/suite_test.go
  • api/v1alpha1/agentworkflow_types.go
  • api/v1alpha1/agentworkflowrun_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • README.md

Comment thread internal/controller/agentworkflowrun_controller.go Outdated
fabianvf added a commit to fabianvf/agentic-controller that referenced this pull request Aug 3, 2026
Rename the config fields to say what they are: AgentPrompt, WorkflowGuide,
StageInstructions. cfg.Instructions was ambiguous next to the model and
provider fields.

Read KONVEYOR_WORKFLOW_GUIDE, falling back to KONVEYOR_PLAYBOOK_INSTRUCTIONS.
that merge rather than depending on merge order. Drop the fallback once konveyor#80 has
landed everywhere.

Correct the staging rules: the harness commits .gitignore and
.konveyor/analysis.json itself, so "you decide what gets committed" overstated
the agent's control.

Rename the ## Migration Context header to ## Workflow Guide. The prompt package
is general purpose and shouldn't hardcode migration.

Always end the prompt with exactly one newline. Sections appended "\n\n" but
StageTask appended nothing, so the ending varied with whether a stage task was
set.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Fabian von Feilitzsch <fabian@fabianism.us>

@ibolton336 ibolton336 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — the stage fixes look right and I confirmed the stage-count source-of-truth and restartPolicy test comments are addressed in the latest commit.

One nit on the #52 filter: a param that doesn't match any stage Agent's declarations is now silently dropped, where before it would fail AgentRun validation — so a typo'd param name just vanishes. A V(1) log line or Event when params are filtered out would make that debuggable. Fine as a follow-up.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
harness/README.md (1)

9-24: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Specify a language for both fenced diagrams.

markdownlint reports MD040 for these blocks. Use text after each opening fence.

Proposed fix
-```
+```text
 ┌──────────────────────────────────────────────────────┐
 ...
-```
+```

-```
+```text
 cmd/migration-harness/main.go    CLI entry point (cobra, single "run" command)
 ...
-```
+```

Also applies to: 105-115

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/README.md` around lines 9 - 24, Update both fenced diagram blocks in
the README to specify the text language on their opening fences, using ```text
while leaving the diagram contents unchanged.

Source: Linters/SAST tools

docs/adr/0007-harness-thin-runner-and-skillcard-skills.md (1)

119-119: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced code block.

Line 119 opens a fenced block without a language. markdownlint reports MD040. Use text for the ASCII image.

Proposed fix
-```
+```text
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/adr/0007-harness-thin-runner-and-skillcard-skills.md` at line 119,
Update the fenced code block at the documented ASCII image to include the text
language tag, changing its opening fence to a text-tagged fence while preserving
the image content and closing fence.

Source: Linters/SAST tools

🧹 Nitpick comments (1)
hack/harness-test/workflow-resources.yaml (1)

154-173: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise stage-specific parameter filtering in this fixture.

This AgentWorkflowRun has no spec.params. The filter does not run. Add values for max_turns and max_fix_iterations, then verify that plan and execute receive only max_turns while verify receives both parameters.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/harness-test/workflow-resources.yaml` around lines 154 - 173, Add a
spec.params section to the AgentWorkflowRun fixture containing values for
max_turns and max_fix_iterations. Configure the fixture so plan and execute
receive only max_turns, while verify receives both parameters, exercising the
stage-specific parameter filtering path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/controller/agentworkflowrun_controller_test.go`:
- Around line 123-125: Update the test around the AgentWorkflowRun stage
definitions to create a second Agent with a distinct declared parameter,
reference each Agent from a different stage, and provide both parameters in the
workflow run. Extend the assertions for the resulting AgentRuns so each stage
receives only the parameter declared by its referenced Agent, using the existing
test helpers and assertion flow.

In `@internal/controller/agentworkflowrun_controller.go`:
- Around line 160-168: Snapshot each stage’s complete definition, including
AgentRef and Instructions, along with the workflow guide when initializing the
run, then use that immutable snapshot instead of mutable workflow.Spec.Stages in
the stage execution path around stageStatus. If snapshotting cannot be added,
reject workflow-spec changes while referenced runs remain active.

---

Outside diff comments:
In `@docs/adr/0007-harness-thin-runner-and-skillcard-skills.md`:
- Line 119: Update the fenced code block at the documented ASCII image to
include the text language tag, changing its opening fence to a text-tagged fence
while preserving the image content and closing fence.

In `@harness/README.md`:
- Around line 9-24: Update both fenced diagram blocks in the README to specify
the text language on their opening fences, using ```text while leaving the
diagram contents unchanged.

---

Nitpick comments:
In `@hack/harness-test/workflow-resources.yaml`:
- Around line 154-173: Add a spec.params section to the AgentWorkflowRun fixture
containing values for max_turns and max_fix_iterations. Configure the fixture so
plan and execute receive only max_turns, while verify receives both parameters,
exercising the stage-specific parameter filtering path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e70af337-f93a-4172-a044-bd16d91f5f24

📥 Commits

Reviewing files that changed from the base of the PR and between 3a1a5ae and 3d3e9fc.

📒 Files selected for processing (32)
  • AGENTS.md
  • README.md
  • api/v1alpha1/agentworkflow_types.go
  • api/v1alpha1/agentworkflowrun_types.go
  • api/v1alpha1/groupversion_info.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • changes/unreleased/agentplaybook-controllers.yaml
  • changes/unreleased/agentworkflow-controllers.yaml
  • changes/unreleased/scaffold-crds.yaml
  • cmd/main.go
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • config/crd/kustomization.yaml
  • config/rbac/role.yaml
  • docs/adr/0001-agentic-platform-crd-architecture.md
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • docs/adr/0007-harness-thin-runner-and-skillcard-skills.md
  • docs/slides/demo-2026-07-16.md
  • hack/harness-test/resources.yaml
  • hack/harness-test/workflow-resources.yaml
  • harness/README.md
  • harness/internal/config/config.go
  • harness/internal/config/config_test.go
  • internal/controller/agentrun_controller.go
  • internal/controller/agentrun_controller_test.go
  • internal/controller/agentworkflow_controller.go
  • internal/controller/agentworkflow_controller_test.go
  • internal/controller/agentworkflowrun_controller.go
  • internal/controller/agentworkflowrun_controller_test.go
  • internal/controller/crd_validation_test.go
  • internal/controller/doc.go
  • internal/controller/suite_test.go
💤 Files with no reviewable changes (1)
  • changes/unreleased/agentplaybook-controllers.yaml
🚧 Files skipped from review as they are similar to previous changes (22)
  • docs/adr/0003-hub-curated-api-for-agent-resources.md
  • config/crd/kustomization.yaml
  • changes/unreleased/agentworkflow-controllers.yaml
  • internal/controller/agentrun_controller.go
  • internal/controller/agentrun_controller_test.go
  • internal/controller/crd_validation_test.go
  • docs/slides/demo-2026-07-16.md
  • AGENTS.md
  • internal/controller/doc.go
  • internal/controller/agentworkflow_controller_test.go
  • README.md
  • config/crd/bases/konveyor.io_agentworkflowruns.yaml
  • api/v1alpha1/agentworkflowrun_types.go
  • cmd/main.go
  • config/crd/bases/konveyor.io_agentworkflows.yaml
  • api/v1alpha1/agentworkflow_types.go
  • changes/unreleased/scaffold-crds.yaml
  • api/v1alpha1/groupversion_info.go
  • internal/controller/agentworkflow_controller.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • internal/controller/suite_test.go
  • docs/adr/0001-agentic-platform-crd-architecture.md

Comment thread internal/controller/agentworkflowrun_controller_test.go
Comment thread internal/controller/agentworkflowrun_controller.go
Rename AgentPlaybook/AgentPlaybookRun to AgentWorkflow/AgentWorkflowRun
across CRD types, controllers, tests, CRD manifests, RBAC, docs, and
changelog fragments. KONVEYOR_PLAYBOOK_INSTRUCTIONS renamed to
KONVEYOR_WORKFLOW_GUIDE. Short names updated: ap->aw, apr->awr.

Fix konveyor#51: Change AgentRun sandbox restartPolicy from OnFailure to Never
so that failed stages reach a terminal phase instead of crashlooping
indefinitely.

Fix konveyor#52: Filter workflow-run params to only those the stage Agent
declares. The controller looks up the stage Agent and forwards only
matching params, removing the coupling that forced every stage Agent
to declare every param from other stages.

Add stage metadata env vars (konveyor#68): inject KONVEYOR_WORKFLOW_STAGE and
KONVEYOR_WORKFLOW_STAGE_COUNT into each child AgentRun. The harness
uses these for stage-aware token revocation (revoke only on last stage).

Closes konveyor#63
Fixes konveyor#51
Fixes konveyor#52
Refs konveyor#68

Signed-off-by: David Zager <dzager@redhat.com>
Signed-off-by: David Zager <david.j.zager@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants