Skip to content

OLS-3588: Add reasoningConfig field to Agent CRD#335

Merged
onmete merged 1 commit into
openshift:mainfrom
onmete:OLS-3588-reasoning-config-crd-field
Jul 16, 2026
Merged

OLS-3588: Add reasoningConfig field to Agent CRD#335
onmete merged 1 commit into
openshift:mainfrom
onmete:OLS-3588-reasoning-config-crd-field

Conversation

@onmete

@onmete onmete commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds spec.reasoningConfig optional freeform map (map[string]apiextensionsv1.JSON) to AgentSpec in the Agent CRD
  • Regenerates deepcopy and CRD manifest with additionalProperties: x-kubernetes-preserve-unknown-fields: true
  • Disables nomaps KAL lint rule (deliberate freeform map per spec rule 18)

Implements OLS-3588. Part of the reasoning effort epic OLS-3587.

Spec: crd-api.md rule 18 (merged in #332).

Test plan

  • make test passes (unit tests + API module tests)
  • make api-lint passes (0 issues)
  • go build ./... compiles clean
  • CRD applies to cluster: kustomize build config/crd | kubectl apply -f -
  • Agent CR with reasoningConfig passes validation
  • Agent CR without reasoningConfig still passes validation

Made with Cursor

@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 15, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 15, 2026

Copy link
Copy Markdown

@onmete: This pull request references OLS-3588 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:

Summary

  • Adds spec.reasoningConfig optional freeform map (map[string]apiextensionsv1.JSON) to AgentSpec in the Agent CRD
  • Regenerates deepcopy and CRD manifest with additionalProperties: x-kubernetes-preserve-unknown-fields: true
  • Disables nomaps KAL lint rule (deliberate freeform map per spec rule 18)

Implements OLS-3588. Part of the reasoning effort epic OLS-3587.

Spec: crd-api.md rule 18 (merged in #332).

Test plan

  • make test passes (unit tests + API module tests)
  • make api-lint passes (0 issues)
  • go build ./... compiles clean
  • CRD applies to cluster: kustomize build config/crd | kubectl apply -f -
  • Agent CR with reasoningConfig passes validation
  • Agent CR without reasoningConfig still passes validation

Made with Cursor

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.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 181e37dc-b4ab-49ff-b3aa-b900b0fe5002

📥 Commits

Reviewing files that changed from the base of the PR and between 8834c6c and 02d4692.

⛔ Files ignored due to path filters (2)
  • api/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated.deepcopy.go
  • config/crd/bases/agentic.openshift.io_agents.yaml is excluded by !config/crd/bases/**
📒 Files selected for processing (2)
  • .golangci-kal.yml
  • api/v1alpha1/agent_types.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-sandbox (manual)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .golangci-kal.yml
  • api/v1alpha1/agent_types.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added optional reasoningConfig to Agent tier specifications for provider/model-specific reasoning parameters.
    • Enabled schema validation requiring at least one configuration property when reasoningConfig is set.
    • Updated the smart Agent example to include the new reasoningConfig section.
  • Chores
    • Updated linting configuration to additionally disable the nomaps rule for the kubeapilinter custom settings.

Walkthrough

AgentSpec now supports optional provider/model-specific reasoning parameters through a validated JSON map. The smart tier example documents the field, and the nomaps kube API linter rule is disabled.

Changes

Agent configuration

Layer / File(s) Summary
Reasoning configuration contract
api/v1alpha1/agent_types.go
Adds AgentSpec.reasoningConfig as a non-empty map of JSON values and documents thinking and effort in the smart tier example.
Kube API linter configuration
.golangci-kal.yml
Disables the nomaps rule in the kubeapilinter configuration.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding the reasoningConfig field to the Agent CRD.
Description check ✅ Passed The description accurately summarizes the CRD field addition, lint change, and test status.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

@openshift-ci
openshift-ci Bot requested review from blublinsky and harche July 15, 2026 13:12
@openshift-ci

openshift-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign raptorsun for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Add spec.reasoningConfig freeform map to AgentSpec, allowing cluster
admins to pass provider-specific reasoning parameters (Claude thinking/
effort, Gemini thinking_budget, OpenAI reasoning.effort) through the
Agent CR. The operator will serialize this as LIGHTSPEED_REASONING_CONFIG
env var on sandbox pods (wiring in OLS-3589).

Co-authored-by: Cursor <cursoragent@cursor.com>
@onmete
onmete force-pushed the OLS-3588-reasoning-config-crd-field branch from 8834c6c to 02d4692 Compare July 15, 2026 13:14

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
api/v1alpha1/agent_types.go (1)

85-94: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add API validation and application tests.

The PR explicitly leaves cluster tests unchecked. Cover omitted reasoningConfig, nested arbitrary JSON, and {} rejection from MinProperties=1; also verify the generated CRD accepts the intended payload.

🤖 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 `@api/v1alpha1/agent_types.go` around lines 85 - 94, Add API and application
tests covering omitted ReasoningConfig, nested arbitrary JSON values, and
rejection of an empty object by the MinProperties=1 validation. Verify the
generated CRD schema contains the intended validation and accepts valid
reasoningConfig payloads, and ensure application behavior preserves omission and
serialization of nested values.
.golangci-kal.yml (1)

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

Scope the nomaps exception to Agent.spec.reasoningConfig. That field is the only intentional freeform map here; disabling the rule at the KAL scope can let accidental map[...] additions in other API types slip through lint.

🤖 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 @.golangci-kal.yml at line 24, Restrict the golangci-lint nomaps exclusion to
Agent.spec.reasoningConfig instead of disabling it for the entire KAL scope. Use
the linter’s field-specific exclusion mechanism and preserve nomaps enforcement
for all other API types and map fields.
🤖 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 `@api/v1alpha1/agent_types.go`:
- Around line 86-94: Remove the public ReasoningConfig field and its associated
CRD documentation/validation from the API type until end-to-end support exists.
Do not expose spec.reasoningConfig while the controller and sandbox lack
LIGHTSPEED_REASONING_CONFIG wiring.

---

Nitpick comments:
In @.golangci-kal.yml:
- Line 24: Restrict the golangci-lint nomaps exclusion to
Agent.spec.reasoningConfig instead of disabling it for the entire KAL scope. Use
the linter’s field-specific exclusion mechanism and preserve nomaps enforcement
for all other API types and map fields.

In `@api/v1alpha1/agent_types.go`:
- Around line 85-94: Add API and application tests covering omitted
ReasoningConfig, nested arbitrary JSON values, and rejection of an empty object
by the MinProperties=1 validation. Verify the generated CRD schema contains the
intended validation and accepts valid reasoningConfig payloads, and ensure
application behavior preserves omission and serialization of nested values.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 78968bb0-38d5-4d0e-9534-08b1bb879637

📥 Commits

Reviewing files that changed from the base of the PR and between 3eb6da7 and 8834c6c.

⛔ Files ignored due to path filters (2)
  • api/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated.deepcopy.go
  • config/crd/bases/agentic.openshift.io_agents.yaml is excluded by !config/crd/bases/**
📒 Files selected for processing (2)
  • .golangci-kal.yml
  • api/v1alpha1/agent_types.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • openshift/lightspeed-agentic-sandbox (manual)

Comment thread api/v1alpha1/agent_types.go
@openshift-ci

openshift-ci Bot commented Jul 15, 2026

Copy link
Copy Markdown

@onmete: 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.

@blublinsky

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 15, 2026
@onmete
onmete merged commit afd0a04 into openshift:main Jul 16, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants