-
Notifications
You must be signed in to change notification settings - Fork 20
OLS-3422: Add NoActionRequired phase, API types, reconciler #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,21 @@ func (r *AgenticRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) | |
|
|
||
| // --- Terminal phases (before suspension guard so audit cleanup always runs) --- | ||
| switch phase { | ||
| case agenticv1alpha1.AgenticRunPhaseNoActionRequired: | ||
| if !needsRevision(&run) { | ||
| if hasSandboxClaims(&run) { | ||
| if err := r.Agent.ReleaseSandboxes(ctx, &run); err != nil { | ||
| log.Error(err, "sandbox cleanup failed at terminal phase") | ||
| } | ||
| } | ||
| if r.Audit != nil { | ||
| r.Audit.EndApprovalWait(&run, nil) | ||
| r.Audit.EmitAgenticRunTerminal(ctx, &run, string(phase), terminalReason(&run)) | ||
| r.Audit.EndLifecycleSpan(&run) | ||
| } | ||
| return ctrl.Result{}, nil | ||
| } | ||
|
|
||
|
Comment on lines
+88
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Retry when terminal sandbox cleanup fails.
As per path instructions, Go code must never ignore error returns. 🤖 Prompt for AI AgentsSource: Path instructions |
||
| case agenticv1alpha1.AgenticRunPhaseCompleted, | ||
| agenticv1alpha1.AgenticRunPhaseDenied, | ||
| agenticv1alpha1.AgenticRunPhaseEscalated, | ||
|
|
@@ -135,7 +150,7 @@ func (r *AgenticRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) | |
| // Recover lifecycle trace context for in-progress runs after operator restart (§5). | ||
| // Uses RecoverLifecycleContext (not EnsureLifecycleSpan) to avoid exporting a duplicate span. | ||
| // Also restarts the approval wait span if the run is waiting for execution approval. | ||
| if r.Audit != nil && !isTerminal(phase) { | ||
| if r.Audit != nil && (!isTerminal(phase) || (phase == agenticv1alpha1.AgenticRunPhaseNoActionRequired && needsRevision(&run))) { | ||
| r.Audit.RecoverLifecycleContext(ctx, &run) | ||
| if phase == agenticv1alpha1.AgenticRunPhaseProposed { | ||
| r.Audit.StartApprovalWait(ctx, &run) | ||
|
|
@@ -197,6 +212,12 @@ func (r *AgenticRunReconciler) Reconcile(ctx context.Context, req ctrl.Request) | |
| } | ||
| return r.handleEscalation(ctx, &run, resolved, approval, policy) | ||
|
|
||
| case agenticv1alpha1.AgenticRunPhaseNoActionRequired: | ||
| if needsRevision(&run) { | ||
| return r.handleRevision(ctx, &run, resolved, approval, policy) | ||
| } | ||
| return ctrl.Result{}, nil | ||
|
|
||
| default: | ||
| log.V(1).Info("unhandled phase, no-op", LogKeyPhase, phase) | ||
| return ctrl.Result{}, nil | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
🧩 Analysis chain
🏁 Script executed:
Repository: openshift/lightspeed-agentic-operator
Length of output: 26635
🏁 Script executed:
Repository: openshift/lightspeed-agentic-operator
Length of output: 22973
🏁 Script executed:
Repository: openshift/lightspeed-agentic-operator
Length of output: 29507
Reject no-action results without a diagnosis.
controller/agenticrun/sandbox_agent.goonly logs the missingdiagnosis, andcontroller/agenticrun/results.gostill persists anAnalysisResultwith an emptystatus.diagnosis. Fail the analysis before creating the CR soNoActionRequiredalways carries an explanation.🤖 Prompt for AI Agents