Skip to content

OTA-2084: pkg/agenticrun/controller: Inline AgenticRun prompt, dropping the ConfigMap - #1432

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
wking:drop-agentic-prompt-config-map
Jul 27, 2026
Merged

OTA-2084: pkg/agenticrun/controller: Inline AgenticRun prompt, dropping the ConfigMap#1432
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
wking:drop-agentic-prompt-config-map

Conversation

@wking

@wking wking commented Jul 26, 2026

Copy link
Copy Markdown
Member

I'm not entirely clear on when we stopped needing a ConfigMap. Before c3fe4c0 (#1387), there had been a systemPromptRef for passing in a prompt, and that had needed a ConfigMap. But since c3fe4c0, the prompt has been passed into the Proposal / AgeneticRun via a string property. And since then, the ConfigMap had been the cluster-version operator just passing itself the prompt string. By removing the prompt ConfigMap and just compiling the string into the cluster-version operator, we remove that useless indirection, and can successfully run on default-feature-set clusters where the TechPreviewNoUpgrade installer manifest wasn't getting appied:

$ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n5
I0726 00:46:30.141228       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
I0726 00:46:30.141246       1 controller.go:188] Finished syncing CVO configuration (5.4221ms)
I0726 00:47:11.101773       1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller"
I0726 00:47:11.107717       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
I0726 00:47:11.107740       1 controller.go:188] Finished syncing CVO configuration (6.001307ms)

Summary by CodeRabbit

  • Refactor
    • AgenticRun now relies on a built-in system prompt instead of loading it from a cluster-provided configuration.
    • Controller setup and sync no longer depend on retrieving or validating prompt data from Kubernetes.
  • Chores
    • Removed the shipped namespace manifest.
    • Removed the update advisory prompt configuration previously delivered via a ConfigMap.
  • Tests
    • Updated controller and operator tests to match the new prompt provisioning behavior.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The AgenticRun controller now uses an embedded advisor prompt instead of a ConfigMap. Prompt configuration, retrieval logic, related manifests, and the ConfigMap getter passed during CVO construction are removed.

Changes

AgenticRun prompt configuration

Layer / File(s) Summary
Embedded prompt and controller contract
pkg/agenticrun/controller.go
The prompt is embedded, ConfigMap getter wiring is removed, and PromptConfigMap configuration is deleted.
Synchronization and construction wiring
pkg/agenticrun/controller.go, pkg/cvo/cvo.go
Synchronization passes the embedded prompt to AgenticRun creation, while CVO constructs the controller without a ConfigMap getter.
Test updates
pkg/agenticrun/controller_test.go, pkg/cvo/availableupdates_test.go
Tests are updated for the simplified controller constructor and no longer mock ConfigMap retrieval.
Prompt resource removal
install/0000_00_cluster-version-operator_45_openshift-lightspeed_namespace.yaml, install/0000_00_cluster-version-operator_50_lightspeed-prompts.yaml
The OpenShift Lightspeed namespace and advisor prompt ConfigMap manifests are removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CVO
  participant AgenticRunController
  participant getAgenticRuns
  CVO->>AgenticRunController: construct without ConfigMap getter
  AgenticRunController->>getAgenticRuns: pass embedded prompt
Loading
🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: inlining the AgenticRun prompt and removing the ConfigMap dependency.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PASS: The changed test files use plain testing/t.Run subtests only; no Ginkgo It/Describe/When/Context titles were added or made dynamic.
Test Structure And Quality ✅ Passed The PR only updates unit-test wiring; there are no new Ginkgo blocks, cluster waits, or resource lifecycles introduced, and existing cleanup in helpers remains intact.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes unit tests and controller code, and no modified file contains It/Describe/Context/When specs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PASS: The changed test files are plain Go unit tests (testing.T); no Ginkgo e2e tests or multi-node/SNO assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed The patch only inlines/removes the prompt ConfigMap and updates call sites; no new pod affinity, nodeSelector, replicas, or topology logic was added.
Ote Binary Stdout Contract ✅ Passed Touched files only inline the prompt and remove ConfigMap wiring; no main/init/TestMain/suite setup writes to stdout were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the modified tests are unit tests using fake clients/httptest, with no IPv4 hardcodes or external network calls.
No-Weak-Crypto ✅ Passed PASS: Changed files only inline the AgenticRun prompt and remove ConfigMap wiring; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons appear.
Container-Privileges ✅ Passed The PR only deletes a Namespace/ConfigMap and updates Go wiring; no added manifest sets privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive-data logging was introduced; the diff removes prompt ConfigMap lookup logs, and the remaining klog calls don’t emit secrets/PII.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@wking wking changed the title pkg/agenticrun/controller: Inline AgenticRun prompt, dropping the ConfigMap OTA-2084: pkg/agenticrun/controller: Inline AgenticRun prompt, dropping the ConfigMap Jul 26, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 26, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

@wking: This pull request references OTA-2084 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

I'm not entirely clear on when we stopped needing a ConfigMap. Before c3fe4c0 (#1387), there had been a systemPromptRef for passing in a prompt, and that had needed a ConfigMap. But since c3fe4c0, the prompt has been passed into the Proposal / AgeneticRun via a string property. And since then, the ConfigMap had been the cluster-version operator just passing itself the prompt string. By removing the prompt ConfigMap and just compiling the string into the cluster-version operator, we remove that useless indirection, and can successfully run on default-feature-set clusters where the TechPreviewNoUpgrade installer manifest wasn't getting appied:

$ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n5
I0726 00:46:30.141228       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
I0726 00:46:30.141246       1 controller.go:188] Finished syncing CVO configuration (5.4221ms)
I0726 00:47:11.101773       1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller"
I0726 00:47:11.107717       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
I0726 00:47:11.107740       1 controller.go:188] Finished syncing CVO configuration (6.001307ms)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
pkg/agenticrun/controller.go (1)

87-93: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Remove the obsolete ConfigMap getter from the remaining constructor call.

NewController now accepts five arguments, but pkg/cvo/availableupdates_test.go at Line 205-221 still passes the removed ConfigMap getter as a sixth argument. This causes a compile-time “too many arguments” failure; remove that function from the test call.

🤖 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 `@pkg/agenticrun/controller.go` around lines 87 - 93, Update the NewController
call in availableupdates_test.go to pass only its five current parameters,
removing the obsolete ConfigMap getter argument while preserving the remaining
argument order.
🤖 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.

Outside diff comments:
In `@pkg/agenticrun/controller.go`:
- Around line 87-93: Update the NewController call in availableupdates_test.go
to pass only its five current parameters, removing the obsolete ConfigMap getter
argument while preserving the remaining argument order.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: eb82933b-99f4-43bd-8bc4-d7e87b8f850a

📥 Commits

Reviewing files that changed from the base of the PR and between 977be36 and f2a808f.

📒 Files selected for processing (4)
  • install/0000_00_cluster-version-operator_45_openshift-lightspeed_namespace.yaml
  • install/0000_00_cluster-version-operator_50_lightspeed-prompts.yaml
  • pkg/agenticrun/controller.go
  • pkg/cvo/cvo.go
💤 Files with no reviewable changes (3)
  • install/0000_00_cluster-version-operator_45_openshift-lightspeed_namespace.yaml
  • install/0000_00_cluster-version-operator_50_lightspeed-prompts.yaml
  • pkg/cvo/cvo.go

@wking
wking force-pushed the drop-agentic-prompt-config-map branch from f2a808f to d3ab552 Compare July 26, 2026 16:13
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 27, 2026
@wking
wking force-pushed the drop-agentic-prompt-config-map branch from d3ab552 to 895848b Compare July 27, 2026 15:54
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 27, 2026
@wking
wking force-pushed the drop-agentic-prompt-config-map branch 6 times, most recently from 8f4b4e6 to 859556e Compare July 27, 2026 17:24
…figMap

I'm not entirely clear on when we stopped needing a ConfigMap.  Before
c3fe4c0 (Use imported Proposal API from
lightspeed-agentic-operator, 2026-05-08, openshift#1387), there had been a
systemPromptRef for passing in a prompt, and that had needed a
ConfigMap.  But since c3fe4c0, the prompt has been passed into the
Proposal / AgeneticRun via a string property.  And since then, the
ConfigMap had been the cluster-version operator just passing itself
the prompt string.  By removing the prompt ConfigMap and just
compiling the string into the cluster-version operator, we remove that
useless indirection, and can successfully run on default-feature-set
clusters where the TechPreviewNoUpgrade installer manifest wasn't
getting appied:

  $ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n5
  I0726 00:46:30.141228       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
  I0726 00:46:30.141246       1 controller.go:188] Finished syncing CVO configuration (5.4221ms)
  I0726 00:47:11.101773       1 controller.go:186] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller"
  I0726 00:47:11.107717       1 controller.go:255] Failed to get prompt ConfigMap openshift-lightspeed/cluster-update-advisory-prompt: configmaps "cluster-update-advisory-prompt" not found
  I0726 00:47:11.107740       1 controller.go:188] Finished syncing CVO configuration (6.001307ms)
@jrangelramos

Copy link
Copy Markdown
Member

/lgtm

It looks good to me, I was able to test it in a cluster and it produced the agenticrun properly deriving the prompt from inline code and not from configmap. However I had to tweak a little to get agentic controller running, here #1434 for it.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 27, 2026
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jrangelramos, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jrangelramos

Copy link
Copy Markdown
Member

/hold
/verified by Jefferson Ramos

I already verified in 5.0.0 live cluster, agentic runs get created properly with the inline prompt. Added hold for @wking in case he wants to verify either.

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 27, 2026
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 27, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jrangelramos: This PR has been marked as verified by Jefferson Ramos.

Details

In response to this:

/hold
/verified by Jefferson Ramos

I already verified in 5.0.0 live cluster, agentic runs get created properly with the inline prompt. Added hold for @wking in case he wants to verify either.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@wking

wking commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Cluster bootstrap failures are unrelated to this pull.

/test e2e-agnostic-ovn-upgrade-into-change e2e-agnostic-ovn-techpreview-serial-2of3

@wking

wking commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

ClusterBot build 5.0,openshift/cluster-version-operator#1432,openshift/cluster-version-operator#1434 (logs) gave me:

$ oc image info registry.build10.ci.openshift.org/ci-ln-m01zi82/release:latest | grep Digest
Digest:      sha256:6ab40c482e6db74b808d38b262322a99f0c90b48213846a8c0d7aec360aa0bb3

I updated a demo cluster that has the AgenticRun CRD installed, setting some unsafe knobs to allow updating to an unsighed, CI image in this throw-away cluster:

$ oc patch clusterversion version --type json -p '[{"op": "add", "path": "/spec/overrides/-", "value": [{"group": "config.openshift.io", "kind": "ClusterImagePolicy", "name": "openshift", "namespace": "", "unmanaged": true}]}]'
$ oc delete clusterimagepolicy openshift
$ oc adm upgrade --force --allow-explicit-upgrade --to-image registry.build10.ci.openshift.org/ci-ln-m01zi82/release@sha256:6ab40c482e6db74b808d38b262322a99f0c90b48213846a8c0d7aec360aa0bb3

And after that update completes, it looks good to me:

$ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail
$ oc -n openshift-cluster-version logs -l k8s-app=cluster-version-operator --tail -1 | grep controller.go | tail -n4
I0727 20:36:27.603243       1 controller.go:241] Skipping agentic run creation: cluster is progressing (Working towards 5.0.0-0-2026-07-27-192510-test-ci-ln-m01zi82-latest: 894 of 1033 done (86% complete), waiting on machine-config)
I0727 20:36:27.603258       1 controller.go:191] Finished syncing CVO configuration (20.646268ms)
I0727 20:40:22.328826       1 controller.go:189] Started syncing CVO configuration "ClusterVersionOperator/agenticrun-lifecycle-controller"
I0727 20:40:34.227007       1 controller.go:191] Finished syncing CVO configuration (11.89818018s)
$ oc -n openshift-lightspeed get agenticruns
NAMESPACE              NAME                                                              AGE
openshift-lightspeed   ota-5-0-0-0-2026-07-27-192510-test-ci-ln-m01zi82-latest-to-5xxx   62s

Hmm, not clear why there's only one AgenticRun, when there are two "supported" updated via dummy Fauxinnati data:

$ oc adm upgrade recommend
Failed to check for at least some preconditions: no token is currently in use for this session
Upstream update service: https://fauxinnati-fauxinnati.apps.ota-stage.q2z4.p1.openshiftapps.com/api/upgrades_info/graph
Channel: simple

Updates to 5.1:

  Version: 5.1.0
  Image: quay.io/openshift-release-dev/ocp-release@sha256:00000000000000000000000000000000000000000000000000000000004c4f28
  Reason: RiskNameNotCompatibleWithReasonProperty
  Message: Parent credentials secret must be restored prior to upgrade: kube-system/aws-creds

Updates to 5.0:
  VERSION     ISSUES
  5.0.1       no known issues relevant to this cluster

But whatever, better than failing on the prompt ConfigMap issue.

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 27, 2026
@wking

wking commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

CustomResourceValidationRules and NewOLMConfigAPI failures are unrelated to this pull:

/override ci/prow/e2e-aws-ovn-techpreview

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@wking: Overrode contexts on behalf of wking: ci/prow/e2e-aws-ovn-techpreview

Details

In response to this:

CustomResourceValidationRules and NewOLMConfigAPI failures are unrelated to this pull:

/override ci/prow/e2e-aws-ovn-techpreview

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@wking: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit d6c8583 into openshift:main Jul 27, 2026
20 checks passed
@wking
wking deleted the drop-agentic-prompt-config-map branch July 27, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants