Show Session runtime state in Session server#1481
Closed
gjkim42 wants to merge 1 commit into
Closed
Conversation
gjkim42
marked this pull request as ready for review
July 14, 2026 12:10
There was a problem hiding this comment.
2 issues found across 10 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/sessionserver/web/styles.css">
<violation number="1" location="internal/sessionserver/web/styles.css:45">
P3: Running session dots now pulse indefinitely even when a user requests reduced motion. Gate this new animation behind `prefers-reduced-motion: no-preference` while retaining the static running color and halo.</violation>
</file>
<file name="internal/sessionruntime/server.go">
<violation number="1" location="internal/sessionruntime/server.go:538">
P2: A reconnecting client can finish with `Running` after a turn has completed: this snapshot is not ordered with live journal events and may be delivered after `turn.completed`. Serialize status snapshots with the subscription stream, or attach a journal cursor so clients discard snapshots superseded by later events.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| case "subscribe": | ||
| subscribe(request.Since) | ||
| case "status": | ||
| out <- Event{Type: EventRuntimeStatus, RuntimeState: s.runtimeState()} |
There was a problem hiding this comment.
P2: A reconnecting client can finish with Running after a turn has completed: this snapshot is not ordered with live journal events and may be delivered after turn.completed. Serialize status snapshots with the subscription stream, or attach a journal cursor so clients discard snapshots superseded by later events.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/sessionruntime/server.go, line 538:
<comment>A reconnecting client can finish with `Running` after a turn has completed: this snapshot is not ordered with live journal events and may be delivered after `turn.completed`. Serialize status snapshots with the subscription stream, or attach a journal cursor so clients discard snapshots superseded by later events.</comment>
<file context>
@@ -516,6 +534,8 @@ func (s *Server) handleConnection(ctx context.Context, connection net.Conn) {
case "subscribe":
subscribe(request.Since)
+ case "status":
+ out <- Event{Type: EventRuntimeStatus, RuntimeState: s.runtimeState()}
case "message":
subscribe(0)
</file context>
| .session-item.active { background: #fff; box-shadow: 0 4px 14px rgba(35,49,42,.06); } | ||
| .phase-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #9ca69f; } | ||
| .phase-dot.ready { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); } | ||
| .phase-dot.running { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); animation: pulse 1.1s infinite; } |
There was a problem hiding this comment.
P3: Running session dots now pulse indefinitely even when a user requests reduced motion. Gate this new animation behind prefers-reduced-motion: no-preference while retaining the static running color and halo.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/sessionserver/web/styles.css, line 45:
<comment>Running session dots now pulse indefinitely even when a user requests reduced motion. Gate this new animation behind `prefers-reduced-motion: no-preference` while retaining the static running color and halo.</comment>
<file context>
@@ -42,7 +42,8 @@ button { color: inherit; }
.session-item.active { background: #fff; box-shadow: 0 4px 14px rgba(35,49,42,.06); }
.phase-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #9ca69f; }
-.phase-dot.ready { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); }
+.phase-dot.running { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); animation: pulse 1.1s infinite; }
+.phase-dot.waiting { background: #7e9186; box-shadow: 0 0 0 3px rgba(126,145,134,.1); }
.phase-dot.failed { background: #c55b5b; }
</file context>
Suggested change
| .phase-dot.running { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); animation: pulse 1.1s infinite; } | |
| .phase-dot.running { background: #4b9a6f; box-shadow: 0 0 0 3px rgba(75,154,111,.12); } | |
| @media (prefers-reduced-motion: no-preference) { .phase-dot.running { animation: pulse 1.1s infinite; } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Ready Sessions currently expose only their infrastructure phase, so users cannot tell whether an agent is actively running a turn or waiting for input.
This PR adds an authoritative runtime status query and exposes
RunningorWaitingfor every ready Session in the Session server API. The sidebar and selected Session header render that state, while non-ready Sessions continue to show their infrastructure phase. WebSocket clients also request a fresh status snapshot when connecting so reloads and reconnects do not retain stale state.Which issue(s) this PR is related to:
Fixes #1473
Special notes for your reviewer:
The Session list queries ready Session Pods concurrently with a bounded limit and a four-second request timeout. Unit coverage exercises running, idle, and input-waiting states; the existing Session e2e flow now verifies status while disconnected and after reconnecting. The e2e suite is intended to run in CI.
Validation:
env -u CODEX_HOME -u CODEX_AUTH_JSON make testmake verifyDoes this PR introduce a user-facing change?
Summary by cubic
Show live runtime state for ready Sessions in the Session server and UI (Fixes #1473). Users can see if an agent is Running or Waiting; WebSocket clients refresh status on connect.
runtimeState("Running" | "Waiting") for ready Sessions; non-ready Sessions still exposephase.statusclient request andruntime.statusevent, pluskelos-session-runtime statusto query the socket.statusrequest on connect and updates on incoming events; unit and e2e tests cover running/waiting and reconnects.Written for commit e587c1a. Summary will update on new commits.