Repository navigation
feat(chat): restart the gateway from the repeat session-start error card - #20490
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check that the 409 pre-check in [DESIGN-REVIEWED] 40ffd17 Description read[DESCRIPTION-READ] d7353c9f9c6b810cc06ac4990e0ef3e24abf7c2e6e639f15e3779948ee3385a6 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 Check one thing before merge: a real restart from the card on a live gateway, including the page reload. The author says this was not verified. What this change shipsInventory (8 items) — 8 justifiedIntent: let a dashboard-only user get out of the repeat session-start dead end without a terminal. This is an ADDITION, and it carries one endpoint FIX that it depends on.
[FIRST-PRINCIPLES-REVIEWED] 40ffd17 Description read[DESCRIPTION-READ] 57006907b5fbd45ad06ea84af6c3539023a44f04119bc4af57bbb6e3ea3de7a2 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The blind reader understood "Restart gateway" but rated it only "a guess", and the failure states show raw server text they could not read. Watch
Suggestions
[UX-REVIEWED] 40ffd17 Description read[DESCRIPTION-READ] 48b8ed5467583a6d2037781e30a816fbb3301ac6c340bdb90f097eb283d201b5 That sha256 names everything this verdict read: the PR description, plus the 17 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: |
6a5ae9f to
f791f56
Compare
|
[operator: bolichen97] Dispositions for the round-1 findings on
|
f791f56 to
f23e82b
Compare
|
[operator: bolichen97] Dispositions for the round-2 findings on
|
f23e82b to
125f55e
Compare
|
[operator: bolichen97] Dispositions for the round-3 findings on
|
125f55e to
f3307b9
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
ce8374f to
6f41be0
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
6f41be0 to
40ffd17
Compare
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97] Design punchline (40ffd17), the pre-check running before the coalesce latch while a restart is in flight:
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved by a maintainer after reading the review lanes: every lane is clean on this head, and the automated triage held it only on a size, path, category or doc rule.
Problem / Motivation
Goal: When a chat's session start fails twice in a row, the user can restart the gateway from the error card itself instead of needing a terminal.
After two consecutive failed session starts the error card withholds Resume (#13746) and tells the user to run
kirocrew restartin a terminal. A dashboard-only user has no button on that screen and no way to copy the command, so the card is a dead end for them.Why it matters
Anyone who only uses the dashboard (desktop app, remote gateway, a teammate's shared box) hits a red card whose only remedy is outside the product. They are stuck until someone with a shell restarts the gateway.
Not a goal
session_start_repeatrefusal.POST /api/restart(it stays owner-gated, and the gate runs before the new check).session/newstart.What changed (motivation → approach → change)
The card is a dead end because the repeat-start branch only renders prose with a
<code>chip; no host passes it an action, thoughapi.restartGateway()already exists for Settings and Dev Fleet.The card reuses what the product already has for both remedies. The restart is the shared
RestartGatewayButton(the two-step armed control Settings → About and the speech settings use), imported unchanged frompages/settings/AboutPanelUpdateFlow.tsx, the module #20534 split out, which holds only the About panel's update actions, not the Settings page. The press runs auseMutation, so offline it stays paused and pending. Only the endpoint's 200 means accepted; any rejection is a failure: anErrorNoticewith a plain-words title, the server's sentence below, and no Ask-the-agent (noHandoffReason: that chat would need the same failing start). The owner gate's 403 says "This account can't restart the gateway.", drops the button and shows one line for whoever runs the gateway, with the command; the endpoint's cannot-run refusal (its 409code, read withapiErrorCode) drops the button too, since pressing again meets the same refusal, and shows the terminal hint; any other failure keeps the button, with the cost line still in view, beside "Press Restart gateway again, or runkirocrew restartin a terminal." Command chips use the sharedsettingRef/CopyCommandButton./api/restartreplied 200 and only then ran_restart_gateway, so a restart that could not run (an invalid launcher or interpreter path) was told only as a later progress step, which no restart control reads: this card, Settings → About and the speech settings all kept saying "restarting". The fix is at that root.src/kiro_crew/dashboard/handlers/updates.pymoves those pre-drain refusals into_resolve_restart_target; the endpoint runs it after the owner gate and before its 200 and answers a refusal as a 409 with the same sentence and a machine-readablecode(restart_launcher_invalid,restart_interpreter_missing), and_restart_gatewaystill re-checks when it commits. All three controls already show anApiError's message, so they all get it.website/src/pages/chat/ErrorCard.tsxgainsonRestartGateway. On a repeat row it shows a new hint (what the gateway is, and that a restart interrupts everything running on it, including your other chats, while chat history is kept and a cut-off reply can be resumed afterwards), the button, then a restarting line. A real restart always pushes arestartingprogress step, which arms the update reload latch, so the page reloads on reconnect and that reload ends the flow, as it does for Settings → About.website/src/pages/chat/transcriptRenderers.tsxpasses it only to the repeat row;website/src/pages/chat/page/transcriptRendering.tsx(where the chat page builds its renderers since #20388) passesapi.restartGateway, not on embed / popout. The new keys land inen.manual.jsonand the eleven shipped translations,en-XAis regenerated, the capture harness asserts the flow, and thelearn-cron-dashboard.mdspec describes it.Backwards compatibility
Compatible: new optional props on
ErrorCardand on the transcript renderer options; a host that does not pass them renders the same card as today, plus the copy control.RestartGatewayButtonis reused as is.POST /api/restartnow answers a restart that cannot run with a 409{ok: false, error}instead of a 200 followed by anerrorprogress step; its only callers are the dashboard's restart controls, which all show anApiError.Removes nothing: the terminal hint and its catalog key stay as the fallback; no endpoint, kind or key is removed or renamed;
_restart_gatewaykeeps its own checks and messages.Tests
ErrorCard.test.tsx: the shared button replaces the terminal hint and Resume stays withheld; the first press only arms; the second calls the restart once and shows the restarting line with no button; a request the gateway never answered is a failure (notice, retry hint, button kept); offline, the press waits and sends nothing; a 403 shows through anErrorNoticealert with no hand-off, one line for whoever runs the gateway with the command chip, no terminal hint and no button; a lapsed-cookie 403, a 500 and a 409 without a cannot-run code keep the retry; the endpoint's 409 shows its reason under the title and the terminal hint, with no retry hint and no button; the chip's shared copy control copieskirocrew restartand reports a dead clipboard.test_update_channel_and_restart.py: a broken launcher and a missing interpreter are each answered 409 with the restart's own sentence and carry theircode, and start no restart task; the missing interpreter also releases a deferred restart, as_restart_gatewaydoes. The restart suites (test_restart_*,test_managed_launcher_restart, owner gate, slack gateway): 541 pass.transcriptRenderers.test.tsx:onRestartGatewayreaches only the newest repeat row, never an older row or a single failure that still has Resume.updates.py, the sync-io-in-async gate,tsc -p tsconfig.app.json, eslint at CI's warning cap,gen:ui --check,i18n:check,i18n:render, i18n key / source-string checks, theme / phantom / restyle ratchets, jscpd, bundle size / chunk cycles, semgrep on the diff, docs-lint. Frontend related set: 13,447 pass; 12 fail in 7 files (DiffBlock.streaming,ArtifactDetailPage,SchedulePage.secrets, ...). The same 12 fail on a cleanorigin/mainworktree with the same setup (a sharednode_moduleslink that vite's fs guard denies), so they are local-environment, not this diff.Manual verification
node website/scripts/capture-session-start-repeat.mjsagainst the built SPA with every/apicall stubbed: all assertions pass in dark and light (older row is plain prose; newest row has the button and no Resume, and its hint names the cost; the first press arms and sends nothing; the second sends exactly one/api/restartand the button goes; a 403 shows the ErrorNotice with no hand-off and one "ask whoever runs this gateway … they can runkirocrew restart" line with its copy control, with no terminal hint, no restart hint and no button; the copy control reports its outcome; the endpoint's 409 refusal shows the titled notice, its sentence below, and the terminal hint, with no button; a 500 keeps the button, the cost line and the retry hint; the restarting frame mutes the failure prose). Not verified here: a real restart against a live gateway, including the reload it causes; the endpoint's new 409 is covered by its handler tests above.Screenshots / video
Second failure, chat page (dark):
First press arms the shared button (dark):
After the second press; the failure prose above is muted once the restart is accepted (dark):
A refused (403) restart: ErrorNotice and one line for whoever runs the gateway, with the copyable command; no button (light):
The copy control after copying (dark):
The endpoint's 409 for a restart that cannot run: the notice with its reason and the terminal hint, no button (dark):
Any other failure (an unhandled 500): the notice, the cost line with what survives, the retry hint and the kept button (light):
Other theme
Related Issues
Closes #13791
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)