Repository navigation
feat(ui): automatic session attention states in the sidebar - #111035
Conversation
…, approval, failed run)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2049a1b1b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cloudWorkerActive: isStoppableCloudWorkerPlacement(row.placement), | ||
| hasAutomation: row.hasAutomation === true, | ||
| unread: row.unread === true, | ||
| attention: this.resolveSessionAttention(row), |
There was a problem hiding this comment.
Surface attention on the hidden main-session row
This derives attention only for SidebarRecentSession rows, but selectedAgentSessionRows() subsequently removes the selected agent's main session because renderHomeRow() is its sole sidebar entry point (ui/src/components/app-sidebar-session-navigation.ts:560-576 and ui/src/components/app-sidebar.ts:194-234). Since the Home row still renders only running/unread state, a pending question, approval, or failed run in the rolling main session—the default and most common chat session—shows none of the new attention UI. Apply the same attention projection and rendering to the Home row.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c06fc36563
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| child.runningChildCount > 0 || | ||
| child.attention.kind !== "none", |
There was a problem hiding this comment.
Preserve attention rows across top-level pagination
When an attention-bearing top-level session falls after the default 10-row limit, zonedVisibleSections() still filters it through limitSidebarSessionRows(), which preserves only active or pinned rows; this new exception applies only to the four-child cap. In the default expanded section there is also no collapsed-section attention dot, so a pending question, approval, or failure remains invisible until the user manually loads more sessions. Preserve attention rows through the top-level pagination filter as well.
Useful? React with 👍 / 👎.
| startedAt: undefined, | ||
| endedAt: undefined, | ||
| runtimeMs: undefined, | ||
| lastRunError: undefined, |
There was a problem hiding this comment.
Clear run errors in every lifecycle restart path
This clears lastRunError for the standard visible-turn recovery path, but sibling lifecycle starts do not maintain the new invariant. For example, buildRestartSafeChatTranscriptState() sets a previously failed session to running without clearing the old reason (src/gateway/server-methods/chat-restart-recovery.ts:350-376), and if admission then fails before a lifecycle error, terminalizeRestartSafeChatAdmission() sets status back to failed without supplying a new reason (src/gateway/server-methods/chat-restart-recovery.ts:401-414). The sidebar consequently attributes the previous run's error to the new failure; propagate this clearing to every lifecycle reset/start path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 893a6e6d75
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| setQuestionPromptClient(this.questionPromptState, client); | ||
| if (client) { |
There was a problem hiding this comment.
Clear cached questions when list recovery is unavailable
When the UI reconnects to a gateway that does not advertise question.list—for example after switching endpoints or downgrading—the client becomes null, but setQuestionPromptClient() leaves the existing prompt map intact and the guarded refresh never runs. Any question cached from the previous connection therefore continues to mark its persisted session as waiting until its original expiry, even though the new gateway cannot resolve it; clear or invalidate cached prompts when connected recovery is unavailable while retaining them for ordinary temporary disconnects.
Useful? React with 👍 / 👎.
|
Codex review: found issues before merge. Reviewed July 18, 2026, 8:24 PM ET / July 19, 2026, 00:24 UTC. Summary PR surface: Source +846, Tests -21, Other +50. Total +875 across 30 files. Reproducibility: not applicable. as a feature PR: the reported sidebar visibility gap is directly represented by the added UI fixtures and screenshot, rather than a current-main bug reproduction. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Keep the automatic-attention design, but preserve existing plugin slot compatibility with an explicitly reviewed storage/projection shape and invalidate recovered question state when a newly connected gateway cannot authoritatively list it. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR: the reported sidebar visibility gap is directly represented by the added UI fixtures and screenshot, rather than a current-main bug reproduction. Is this the best way to solve the issue? No. The automatic-attention approach is appropriate, but the current persisted field reservation and cross-gateway cache handling are not the narrowest upgrade-safe implementation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 45f6543c9ace. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +846, Tests -21, Other +50. Total +875 across 30 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
…#111035) * feat(ui): automatic session attention states in the sidebar (question, approval, failed run) * test(ui): split attention presentation and read-marker cases under line budgets * fix(ui): restore precise chat-pane test-support signatures
…#111035) * feat(ui): automatic session attention states in the sidebar (question, approval, failed run) * test(ui): split attention presentation and read-marker cases under line budgets * fix(ui): restore precise chat-pane test-support signatures
What Problem This Solves
When an agent session is blocked or broken — waiting on a question, waiting on a permission approval, or dead because inference failed (auth expired, out of credits) — the sidebar row looks exactly like a healthy idle session. The user learns about blocked agents only by opening each session.
Why This Change Was Made
Maintainer-requested: sessions that need the user must say so automatically, with no agent effort, as exception-only chrome consistent with the quiet-sidebar series (#110448-#110800).
User Impact
Each session row derives a closed attention state
none | question | approval | error:question.list+ events), so it survives reconnects and clears the moment the question is answered.lastRunError(sanitized, 160-char cap) carries the short reason to rows; acknowledgment is durable via the existinglastReadAtread marker — opening the session marks it read, a refresh does not resurrect dismissed failures, and a new failure re-raises attention.childSessionKeysmatching for unloaded direct children), bypasses the 4-child display cap, and collapsed sections show an amber dot next to the running dot. Question/approval outrank error; rows are never reordered.Mock-harness fixtures now demonstrate all three states (question, approval, failed with out-of-credits reason):
Evidence
node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts— 133 pass post-rebase (new attention case file: each state renders icon+subtitle, precedence, collapsed-section dot, child bubbling incl. unloaded children, cap bypass, durable dismissal incl. refresh survival and re-failure).