PR 319, round three

rancher/rancher-ai-ui, torchiaf. Cut at 7bff0f30 (your last full review), 8 commits, head 88cd74c9. Two passes: Cody's my-pr-review-new-commits (A, in session) and ours (B, fresh agent that had not seen A). 2026-11-24.

Preview: https://rancheraipr319r.mf-created-dashboard.ui.rancher.space/dashboard/ - built from 88cd74c9, backend rancher.13.48.147.135.sslip.io

Verdict: request changes, for two points. All 13 threads are resolved. The new plan logic leaves two cases where the user gets no notification and no dot. Both need planning on; the agent chart ships with plan.enabled: false and planApproval.enabled: false.

Threads resolved this round

ThreadStateChecked on the preview
Notifications on every </message>Addressed, with one rare leftoverErrors send one notification, running steps none, a question or confirmation one each. An error is still followed by "Response complete" when the same turn also recommends an agent (point 4).
clearBeforeUnload nameAddressedRenamed. A few comments that repeat the code remain in channel/index.ts.
Permission message coming backAddressedHidden after reopening the chat, prompt granted or dismissed.
Links not reachable by keyboardAddressedTab reaches both links and Enter works; same for the RequiredAction link.
Escaped apostrophe in the accessible nameAddressedThe menu item's name reads "browser's site settings".

New points

Must fix 1. A plan that ends in the message it started in is never notified
useChatMessageComposable.ts:846-847

First step fails with approval off: <message>, plan in_progress, text, plan failed, </message>. No notification, no dot. Same when a retry fails again (approval on or off), and a retry of the last step that succeeds loses "Plan completed". The same failure in step 2 sends "Plan failed" and shows the dot.

The planning message is not complete yet, so it is skipped, and the plan is still marked as notified, so </message> is skipped too. At 7bff0f30 </message> always notified (code read). The tests miss it because the mocked planning message is already completed and every plan e2e starts with an approval in its own message.

Header after step 1 fails, no dot
Step 1 fails: no dot
Header after step 2 fails, dot
Step 2 fails: dot
Chat after step 1 fails
The chat, opened afterwards
Must fix 2. The gate reads a plan that can outlive its chat or its run
useChatMessageComposable.ts:484-488 and :846, channel/message.ts:52

The leftover plan state is on main already; what is new is that notifications depend on it. What the agent sends in these cases is code read.

Header after the reply in the new chat, no dot
Reply in a new chat: no dot
New chat with the reply
The reply that was not announced
Error in the new chat for a plan that succeeded
A plan that succeeded in a new chat
Optional 3. A plan revised from feedback is not announced as a plan
channel/message.ts:56, approval on. Not new since 7bff0f30

It reads "You have unread messages", or "Response complete" without text, while it waits for approval.

Optional 4. An error is still replaced by "Response complete" when its turn recommends an agent
useChatMessageComposable.ts:474 and :658

The suggestion is added before the last message is checked. Rare: the recommendation and a failing final call in the same turn. Control without it: the error only.

Your call 5. Replacing
channel/index.ts:84

Every notification still shares one tag, so "You have unread messages" replaces "Plan completed". Your 2026-11-23 comment said OK for a first iteration; fewer are sent now.

Passes compared

PointABRe-run on the preview
1. Ends in its own messageyesyesyes
2. Sign-in cancelled / error mid-planyesyes (sign-in, socket drop)yes
2. New chat, wrong text, null errormissedyesyes
3. Revised planmissedyesyes
4. Error plus recommendationmissedyesyes

CI at 88cd74c9: unit, lint and i18n pass; e2e fails on one chat.spec planning scroll test that also needed retries on main. notifications.spec 16/16.

What I'd post

Request changes. Intro:

Thanks, steps, questions, confirmations and errors read right now, and I resolved the open threads. Two plan cases still stay silent, see below. The description also still says notifications close after 5 seconds, are opt-in and are cleared before unload.

useChatMessageComposable.ts:847

A plan that ends in the message it started in sends nothing, no notification and no dot: that message isn't complete yet so it's skipped, and the plan is still marked as notified, so the end of the message is skipped too. It happens when the first step fails with plan approval off, and when a retry fails again. The same failure in step 2 sends "Plan failed".

useChatMessageComposable.ts:484

This reads a plan that can be left over from another chat or from a run that never finished. After a new chat is started while a plan runs, or the sign-in of a later step is canceled, plain replies send nothing. If that plan was waiting for an answer, the first reply in the new chat reads "The plan needs your input to continue". A new plan there can also end in "Error processing message: Cannot read properties of null (reading 'role')" and an error notification, although it succeeded.

Optional
channel/message.ts:56

Optional: with plan approval on, a plan revised from feedback reads "You have unread messages", or "Response complete" when it has no text, while it waits for approval.

Optional
useChatMessageComposable.ts:474

Optional: when the same turn also recommends an agent, that suggestion is the last message, so an error is still followed by "Response complete", which replaces it.

Not checked