Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci-kal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ linters:
disable:
- statusoptional # Legacy, not recommended
- nonpointerstructs # Intended for native types, not CRD types
- nomaps # ReasoningConfig is a deliberate freeform map (spec rule 18)
lintersConfig:
conditions:
isFirstField: Warn
Expand Down
20 changes: 19 additions & 1 deletion api/v1alpha1/agent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -81,6 +82,20 @@ type AgentSpec struct {
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=500
MaxTurns int32 `json:"maxTurns,omitempty"`

// reasoningConfig is a freeform map of provider- and model-specific
// reasoning parameters. The exact keys and values depend on the provider
// and model — consult the provider's SDK documentation for supported
// parameters (e.g., Claude: thinking/budget_tokens, Gemini: thinking_budget/
// thinking_level, OpenAI: reasoning.effort/reasoning.summary).
// The operator serializes this map as the LIGHTSPEED_REASONING_CONFIG JSON
// env var on the sandbox pod without validation — the sandbox and upstream
// SDK/API validate at invocation time. Invalid keys are ignored by the
// adapter; invalid values on recognized keys are rejected by the SDK/API.
// When omitted, the env var is not set and the sandbox uses SDK defaults.
// +optional
// +kubebuilder:validation:MinProperties=1
ReasoningConfig map[string]apiextensionsv1.JSON `json:"reasoningConfig,omitempty"`
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

// +kubebuilder:object:root=true
Expand All @@ -99,7 +114,7 @@ type AgentSpec struct {
// The "default" agent must exist; "smart" and "fast" are optional (the
// operator auto-links to "default" if absent).
//
// Example — a high-capability agent tier:
// Example — a high-capability agent tier with extended thinking:
//
// apiVersion: agentic.openshift.io/v1alpha1
// kind: Agent
Expand All @@ -113,6 +128,9 @@ type AgentSpec struct {
// analysisSeconds: 300
// executionSeconds: 600
// maxTurns: 200
// reasoningConfig:
// thinking: "enabled"
// effort: "high"
//
// Example — a fast, cost-efficient agent tier:
//
Expand Down
39 changes: 23 additions & 16 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions config/crd/bases/agentic.openshift.io_agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ spec:
name per step.\n\nAgent is cluster-scoped. The metadata.name serves as the
tier identifier.\nThe \"default\" agent must exist; \"smart\" and \"fast\"
are optional (the\noperator auto-links to \"default\" if absent).\n\nExample
— a high-capability agent tier:\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind:
Agent\n\tmetadata:\n\t name: smart\n\tspec:\n\t llmProvider:\n\t name:
vertex-ai\n\t model: claude-opus-4-6\n\t timeouts:\n\t analysisSeconds:
300\n\t executionSeconds: 600\n\t maxTurns: 200\n\nExample — a fast,
cost-efficient agent tier:\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind:
— a high-capability agent tier with extended thinking:\n\n\tapiVersion:
agentic.openshift.io/v1alpha1\n\tkind: Agent\n\tmetadata:\n\t name: smart\n\tspec:\n\t
\ llmProvider:\n\t name: vertex-ai\n\t model: claude-opus-4-6\n\t timeouts:\n\t
\ analysisSeconds: 300\n\t executionSeconds: 600\n\t maxTurns: 200\n\t
\ reasoningConfig:\n\t thinking: \"enabled\"\n\t effort: \"high\"\n\nExample
— a fast, cost-efficient agent tier:\n\n\tapiVersion: agentic.openshift.io/v1alpha1\n\tkind:
Agent\n\tmetadata:\n\t name: fast\n\tspec:\n\t llmProvider:\n\t name:
vertex-ai\n\t model: claude-haiku-4-5\n\t timeouts:\n\t analysisSeconds:
120\n\t executionSeconds: 300\n\t maxTurns: 100"
Expand Down Expand Up @@ -108,6 +109,22 @@ spec:
only alphanumerics, dots, hyphens, underscores, slashes, colons,
and at-signs
rule: self.matches('^[a-zA-Z0-9][a-zA-Z0-9._\\-/:@]*$')
reasoningConfig:
additionalProperties:
x-kubernetes-preserve-unknown-fields: true
description: |-
reasoningConfig is a freeform map of provider- and model-specific
reasoning parameters. The exact keys and values depend on the provider
and model — consult the provider's SDK documentation for supported
parameters (e.g., Claude: thinking/budget_tokens, Gemini: thinking_budget/
thinking_level, OpenAI: reasoning.effort/reasoning.summary).
The operator serializes this map as the LIGHTSPEED_REASONING_CONFIG JSON
env var on the sandbox pod without validation — the sandbox and upstream
SDK/API validate at invocation time. Invalid keys are ignored by the
adapter; invalid values on recognized keys are rejected by the SDK/API.
When omitted, the env var is not set and the sandbox uses SDK defaults.
minProperties: 1
type: object
timeouts:
description: |-
timeouts configures per-step and per-turn timeout limits.
Expand Down