Skip to content

Commit 957bc96

Browse files
Ambient Code Botclaude
andcommitted
fix: address review feedback — remove operator agentStatus writes and fix tooltip accessibility
- Change SessionStatusDot tooltip trigger from span to button for proper accessibility (fixes frontend lint error) - Remove all agentStatus writes from operator (reconciler.go and sessions.go) — agentStatus is now derived at query time from event logs, not stored in CR Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4eeb897 commit 957bc96

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

components/frontend/src/components/session-status-dot.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ export function SessionStatusDot({ phase, className }: SessionStatusDotProps) {
3737
<TooltipProvider delayDuration={300}>
3838
<Tooltip>
3939
<TooltipTrigger asChild>
40-
<span
40+
<button
41+
type="button"
4142
className={cn(
42-
"inline-block w-2.5 h-2.5 rounded-full flex-shrink-0",
43+
"inline-block w-2.5 h-2.5 rounded-full flex-shrink-0 border-0 p-0 cursor-default",
4344
color,
4445
animation,
4546
className

components/operator/internal/handlers/reconciler.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func TransitionToStopped(ctx context.Context, session *unstructured.Unstructured
8484
statusPatch.SetField("phase", "Stopped")
8585
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
8686
statusPatch.SetField("stoppedReason", stopReason)
87-
statusPatch.SetField("agentStatus", "idle")
8887
statusPatch.AddCondition(conditionUpdate{
8988
Type: conditionReady,
9089
Status: "False",
@@ -130,7 +129,6 @@ func TransitionToFailed(ctx context.Context, session *unstructured.Unstructured,
130129
statusPatch := NewStatusPatch(namespace, name)
131130
statusPatch.SetField("phase", "Failed")
132131
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
133-
statusPatch.SetField("agentStatus", "idle")
134132
statusPatch.AddCondition(conditionUpdate{
135133
Type: conditionReady,
136134
Status: "False",
@@ -241,7 +239,6 @@ func UpdateSessionFromPodStatus(ctx context.Context, session *unstructured.Unstr
241239
case corev1.PodSucceeded:
242240
statusPatch.SetField("phase", "Completed")
243241
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
244-
statusPatch.SetField("agentStatus", "idle")
245242
statusPatch.AddCondition(conditionUpdate{
246243
Type: conditionReady,
247244
Status: "False",
@@ -258,7 +255,6 @@ func UpdateSessionFromPodStatus(ctx context.Context, session *unstructured.Unstr
258255
log.Printf("Pod %s failed: %s", podName, errorMsg)
259256
statusPatch.SetField("phase", "Failed")
260257
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
261-
statusPatch.SetField("agentStatus", "idle")
262258
statusPatch.AddCondition(conditionUpdate{
263259
Type: conditionReady,
264260
Status: "False",

components/operator/internal/handlers/sessions.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,6 @@ func monitorPod(podName, sessionName, sessionNamespace string) {
19081908
if pod.Status.Phase == corev1.PodSucceeded {
19091909
statusPatch.SetField("phase", "Completed")
19101910
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
1911-
statusPatch.SetField("agentStatus", "idle")
19121911
statusPatch.AddCondition(conditionUpdate{Type: conditionReady, Status: "False", Reason: "Completed", Message: "Session finished"})
19131912
_ = statusPatch.Apply()
19141913
_ = deletePodAndPerPodService(sessionNamespace, podName, sessionName)
@@ -1972,7 +1971,6 @@ func monitorPod(podName, sessionName, sessionNamespace string) {
19721971
log.Printf("Pod %s failed: %s", podName, errorMsg)
19731972
statusPatch.SetField("phase", "Failed")
19741973
statusPatch.SetField("completionTime", time.Now().UTC().Format(time.RFC3339))
1975-
statusPatch.SetField("agentStatus", "idle")
19761974
statusPatch.AddCondition(conditionUpdate{Type: conditionReady, Status: "False", Reason: "PodFailed", Message: errorMsg})
19771975
_ = statusPatch.Apply()
19781976
_ = deletePodAndPerPodService(sessionNamespace, podName, sessionName)
@@ -2013,7 +2011,6 @@ func monitorPod(podName, sessionName, sessionNamespace string) {
20132011
now := time.Now().UTC().Format(time.RFC3339)
20142012

20152013
statusPatch.SetField("completionTime", now)
2016-
statusPatch.SetField("agentStatus", "idle")
20172014
switch term.ExitCode {
20182015
case 0:
20192016
statusPatch.SetField("phase", "Completed")

0 commit comments

Comments
 (0)