Repository navigation
fix(chat): keep a failed phone update item and harness mark in place - #36537
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. Both failures now stay inside their own control, the Notes
[DESIGN-REVIEWED] 90e2b97 Description read[DESCRIPTION-READ] 0a72aa7463dfd224430d395d5557818419f3d6e12dec630c7fcc2c71d76c4c19 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Both parts fix the cause named in #33603, a plain module-level Inventory (8 items) — 6 justifiedIntent: a failed code chunk for the phone update item or the harness mark stays inside that control and can be loaded again, without losing the chat page — FIX.
[FIRST-PRINCIPLES-REVIEWED] 90e2b97 Description read[DESCRIPTION-READ] 9c15696bbcc3c1df1c46df7b86209f0fd6962e296eb6f2b7a289a794b4d6b022 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The screenshots show both failure states. The blind reader understood the new Try Again and Reload page items and said it would use them. Notes
[UX-REVIEWED] 90e2b97 Description read[DESCRIPTION-READ] c9fa4b361e220e551553a522f71158523203e6dbca734f821e63b57f0be58bc8 That sha256 names everything this verdict read: the PR description, plus the 10 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
Code change approver recommendation: A person should decideWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, but it is held at tier pending: being reviewed. The harness mark now has its own ErrorBoundary, with the existing 13px placeholder as its fallback, so a failed chunk no longer reaches the route boundary. lazyRetry gains a Tier: pending: being reviewed. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
|
/ai-review override gpt 4093547 not-applicable: agent: the harness mark is a decorative aria-hidden glyph; the chip still names the harness in its title and aria-label and opens the picker, and the boundary journals the failure. A notice beside the chip plus a string in every locale is scope #33603 does not need. [operator: bolichen97] |
Human judgment recorded@bolichen97 recorded a not-applicable release (class
This decision applies only to this commit. A new push requires a new judgment. |
The phone menu's update item was still a plain module-level lazy(). Its own boundary showed a notice and the agent hand-off but no retry, and because lazy() caches a rejected import, nothing short of a page reload could load it again. lazyRetry gains a `menu` layout for a part inside a Radix dropdown menu: the passive notice, then Try Again, Reload page and the hand-off as menu items. Try Again keeps the menu open, builds a new lazy() and remounts the boundary, then moves focus to the menu once the old item has unmounted. The update item now uses it, which leaves chatLazyParts.lazyRetry.test.ts with no exception. The composer's harness mark is a lazy chunk inside the model chip's button, wrapped only in Suspense, so a failed load reached the route boundary and replaced the whole chat page, composer included. A local boundary now keeps the same 13px placeholder and the failure is still journaled. It shows no notice: the mark is decorative, sits inside a button, and the chip's label already names the harness. Part of #33603. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4093547 to
90e2b97
Compare
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md, website/src/components/chat-input/ContextShelf.tsx and website/src/pages/chat/page/MobileTopBar.tsx since this head went green (2f7e9f2 -> 654781f); CI re-running. The previous head's one red, Source Gates (with Await Fast Gate and Coverage Gate behind it), was main's own docs-lint failure, fixed on main by #36504. The rebased tree passes [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved. On this head the review checked these things. The new menu layout in lazyRetry runs the same retry() as the other layouts, so Try Again really imports the part again. The Radix onSelect preventDefault keeps the menu open. The passive notice's id describes the hand-off item. The harness mark boundary keeps a failed chunk inside the chip and journals it under composer-harness-mark. Each red-on-base test claim was reproduced, and the five named test files passed under several shuffle seeds.
Done well: removing the last KNOWN_PLAIN exception means the static guard now fails any new plain lazy() under pages/chat/.
Optional:
- The menu hand-off now sends
error.messagewhere it used to send the translated sentence. This matches the other layouts and the journal entry. One sentence under Backwards compatibility, or a reply to Design's note, would record that. - The focus-restore effect (lazyRetry.tsx:114) has no test that fails without it, because jsdom's FocusScope already moves focus back into the menu. You could spy on the menu element's
focus, or reword the "focus stays in the menu" message. - No test checks that MobileTopBar.tsx:34 uses
layout: 'menu'. A small test that makes the UpdatePill import fail and asserts the menu holds nobuttonwould cover it.
Problem / Motivation
Goal: When the phone menu's update item or the composer's harness mark fails to load its code, the failure stays inside that control and the rest of the chat page keeps working, and the phone menu offers a Try Again that asks for the code again.
Two chat-page parts listed in #33603 still kept a module-level
React.lazy()after #35043:Suspense. When its chunk failed, the chat route's error card ("Something went wrong / Failed to fetch dynamically imported module: …/HarnessLogo-….js") replaced the whole chat page: the sessions sidebar, the transcript and the composer.lazy()caches a rejected import, so the only way to load it again was a page reload.Why it matters
A chat kept open across an upgrade or on a flaky network can lose the whole chat page, composer included, because the small harness mark on the model chip could not load. On a phone, a failed update item says so but has no way to load it again short of reloading the page.
Not a goal
components/mobileConnect.tsx): its dialog frame is inside the chunk that fails, so its failure needs a frame of its own. Stays tracked in Chat page: other lazy parts still replace the whole page, or never retry, after a failed chunk load #33603.website/src/pierre/), because of their forwarded refs and staged fallbacks. Stays tracked in Chat page: other lazy parts still replace the whole page, or never retry, after a failed chunk load #33603.vite:preloadErrorreload guard inmain.tsx, or how chunks are split.What changed (motivation → approach → change)
A failed harness mark now leaves a blank mark on a chip that still works, and a failed phone update item now offers Try Again and Reload page as menu items.
chat-input/ContextShelf.tsx)pages/chat/page/MobileTopBar.tsx)Cause: both parts kept a plain module-level
lazy(). The harness mark had nothing between it and the route boundary, and the update item's boundary could not retry, becauselazy()caches a rejected import.lazyRetry(components/lazyRetry.tsx) gains amenulayout for a part inside a Radix dropdown menu. It renders the passive inline notice (itsidfromuseId()), then Try Again and Reload page asDropdownMenuItems using the existingcomponents.errorBoundary.*strings, then, unlessaskAgent: false, anErrorNoticeMenuItemhand-off described by the notice. A menu's roving focus reaches items, never a button nested in one. Try Again takes the same path as the other layouts (a newlazy()and a remounted boundary). It callspreventDefault()so the menu stays open and the part loads in place. After the retry commits, focus moves to the menu: focused any earlier, the menu's roving focus handed it straight back to the unmounting Try Again, and in Chromium focus ended up on<body>. The update item now useslazyRetry(…, { layout: 'menu', … }), and its hand-written boundary is gone. The harness mark gets a localErrorBoundary(composer-harness-mark) whose fallback is the placeholder theSuspensealready used. It shows no notice: the mark is decorative, sits inside a button that cannot hold Try Again or Reload, and the chip's label already names the harness. The Routing paragraph oflearn-cron-dashboard.mdnow describes both.Backwards compatibility
Compatible:
lazyRetry's existing layouts render exactly as before.menuis a new value, and both changed parts render the same component when their chunk loads.Removes nothing: the update item's notice and hand-off are still there, with two more menu items beside them, and the harness mark still renders when its chunk loads.
Tests
website/src/test/chatLazyParts.lazyRetry.test.ts: the static check now expects no module underpages/chat/on a plainlazy(), with theKNOWN_PLAINexception forMobileTopBar.tsxremoved. Red on the base (expected [ Array(1) ] to deeply equal []).website/src/test/lazyRetry.menu.test.tsx(new): in an openDropdownMenu, a part whose first import rejects shows the notice, Try Again and Reload page as menu items, and the hand-off witharia-describedbyset to the notice's id, with no nested button.askAgent: falsedrops the hand-off. Try Again keeps the menu open, imports again (2 imports) and renders the part, with focus still in the menu. Red on the base (3 of 3:Unable to find role="menuitem" and name "Try Again"). Without thepreventDefault()the third test fails (the menu closes, so the part never renders). jsdom does not reproduce the focus drop to<body>; the Chromium smoke below covers that.website/src/test/ChatInput.harnessChipLoadFailure.test.tsx(new): aHarnessLogoimport that rejects leavescomposer-model-chiprendered and clickable, with the 13px placeholder incomposer-model-chip-harness, and the boundary above it untouched. Red on the base (the failure stays inside the chip: expected <div …(1)></div> to be null).Proof: not provable -- frontend test (prove.py runs Python only)
Determinism: the three files above plus
ChatInput.harnessChip.test.tsxandlazyRetry.askAgent.test.tsxpassed 20 runs in a row (20/20) and once with--sequence.shuffle --sequence.seed=33603.Manual verification
Run on Ubuntu 24.04.5 LTS (Linux 7.0.0, x86_64) with Chromium 145 through Playwright 1.58.2. The gateway was isolated (
KIROCREW_HOME=$(mktemp -d),kirocrew gateway --port auto --seed minimal --no-tunnel --no-crons, 127.0.0.1) and served the SPA fromnpm run build. Each context blocked service workers, which otherwise serve the chunk pastpage.route, and setsessionStorage['vite-preload-reload-count']='3'to spend main.tsx's reload guard. For the harness mark,/api/chat/slots/*/selection-capabilitieswas answered withmodels_backend: "claude"added: a session on a second, signed-in harness cannot be started on this host, and that field is the only thing the chip reads to draw the mark.Base build, chunk aborted:
Fixed build, same steps:
Try Again after un-blocking the chunk:
What was observed: with the reload guard spent, Try Again runs
import()again and firesvite:preloadError. Chromium sends no new request, because it keeps the failed module record until the page reloads, so the failure shows again with the menu still open and focus on a live menu item, and Reload page is the way out. No update is pending on this host, so the loaded item draws nothing.Happy path, nothing blocked: the harness mark renders on the chip (
harness-logo-claude, chipRuns on Claude Code · Model: auto · Reasoning effort: Default), and the phone menu opens with its usual items and no notice.Related checks on the same tree:
npx tsc -p tsconfig.app.json --noEmitexit 0; the five test files under Tests passed once, 5 more times in a row, and once with--sequence.shuffle --sequence.seed=33603.Screenshots / video
Harness mark, base: the HarnessLogo chunk aborted, and the route's error card replaces the whole chat page.
Harness mark, this PR: the same failure keeps the chat page and the composer; the model chip shows a blank mark before "auto".
Phone menu, base (390x844): the UpdatePill chunk aborted, the notice and Ask the agent with no retry.
Phone menu, this PR: the notice, then Try Again, Reload page and Ask the agent as menu items.
After Try Again, and the happy path
After un-blocking the chunk and Try Again with the reload guard spent: the menu stays open.
Nothing blocked: the harness mark on the chip, and the phone menu as before.
Related Issues
Part of #33603
Sibling sweep
Swept: git grep -nE "\blazy(" -- website/src/pages/chat website/src/components/chat-input website/src/components/mobileConnect.tsx website/src/pierre website/src/components/PreviewTabBody.tsx
Sibling: website/src/components/chat-input/ContextShelf.tsx:18 -- changed here
Sibling: website/src/pages/chat/page/MobileTopBar.tsx -- changed here
Sibling: website/src/components/mobileConnect.tsx:11 -- tracked in #33603
Sibling: website/src/pierre/index.tsx:28 -- tracked in #33603
Sibling: website/src/pierre/tree.tsx:8 -- tracked in #33603
Sibling: website/src/components/chat-input/engine.tsx:8 -- not affected -- ComposerLoadBoundary falls back to the textarea with the draft kept
Pattern harvest
Rule candidate: lint
Pattern: a module-level
React.lazy()component rendered with only aSuspenseabove it and noErrorBoundaryof its own between it and the route;chatLazyParts.lazyRetry.test.tsalready enforces this forpages/chat/, and the same static check could covercomponents/chat-input/.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.