Repository navigation
fix: say the connection dropped when a sign-in poll gets no answer - #35754
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. It is a fix tied to an issue (#34681), with a test that fails on base, and it reuses the existing What this change shipsInventory (5 items) — 5 justifiedIntent: a first-time user whose gateway restarts during a Kiro sign-in should be told the connection dropped and to start over, not shown "Failed to fetch". FIX.
[FIRST-PRINCIPLES-REVIEWED] e0ca298 Description read[DESCRIPTION-READ] 95ccdb0e506d6f8193bb87374e642d2615a4fc324a542b9f77a2efcd48aeebb8 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change rewords one failure screen, but only for the class that [DESIGN-REVIEWED] e0ca298 Description read[DESCRIPTION-READ] ece744375211055298f962a29eed46f84312e4703171a26b66a686e39cc150b9 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The connection-lost screen appears in both themes, and the blind reader read "Start over" correctly and would click it. Notes
[UX-REVIEWED] e0ca298 Description read[DESCRIPTION-READ] f46f15e24529bfae5109e9f537b1b9aa1762f673edc721a357247efbaa80c183 That sha256 names everything this verdict read: the PR description, plus the 6 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: ApproveWhy: the decider estimates an 8% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. This narrow UI fix does what the PR says. When a poll gets no answer (fetch rejection, or a 502/503/504 with no code), the failure screen shows a translated "connection lost, start over" sentence instead of "Failed to fetch". Every 5xx the gateway itself sends from the kas_login handlers is coded (kas_login_unavailable, auth_service_unreachable, device_authorization_failed), so those keep their text. Start over recovers after a restart because the cancel endpoint is idempotent. The hand-off keeps the original error through reportForError. The key is in all 14 locales and uses {{productName}}. The spec doc is updated. Two tests were added, one of which fails without the change. 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 |
buluoray
left a comment
There was a problem hiding this comment.
Approve on ff21264. When a Kiro sign-in poll gets no answer from Kiro Crew (the browser could not reach it, or a proxy answered 502, 503 or 504 without a code), the failure screen now says the connection was lost and to start over, instead of the browser's "Failed to fetch". Every answer the gateway itself gives keeps its own text: an expired code, a denied or failed sign-in, a forgotten sign-in id, and the coded 502 when the auth service is unreachable. Only the wording changes; the poll still stops on the first failure and Start over behaves as before. Both new tests turn red when their guard is removed. The red backend shards fail only on a cloud-launch test that main fixed after this run was created, so the PR needs a rebase onto main for CI to go green. Decisive lines: website/src/components/KasLoginGate.tsx:1196, website/src/components/KasLoginGate.tsx:718-724, website/src/api/queryClient.ts:50-54, src/kiro_crew/dashboard/handlers/kas_login.py:222-247
When the gateway restarted, or the link to it dropped, while a Kiro sign-in was waiting for approval, the sign-in screen showed the browser's raw "Failed to fetch" under "Something went wrong while waiting for approval". It named no cause and no next step. A poll the gateway never answered (a fetch rejection, or a 502/503/504 with no code) now ends with "Sign-in failed" and a sentence saying the connection to Kiro Crew was lost, maybe because it restarted, and to start over. An answer the gateway did send keeps its own text, so its coded 502 for an unreachable Kiro auth service still says that. The agent hand-off keeps the original failure through the report the transport pinned to it. The sentence ships in every language. Closes #34681
ff21264 to
e0ca298
Compare
|
Rebased: main moved in docs/system-specs/modules/kas-auth.md, website/src/components/KasLoginGate.tsx, website/src/components/KasLoginGate.test.tsx and website/src/i18n/locales/*.json since this head's CI ran (ee7a026 -> e7e2146); CI re-running. Two reasons. GitHub reported a conflict in [operator: bolichen97] |
buluoray
left a comment
There was a problem hiding this comment.
Approve on e0ca298. This head is a rebase of ff21264, which we approved. The patch is the same: 15 of its 16 files carry the same added and removed lines, and in the one doc file the PR's own sentence is only wrapped differently, with no word changed. What we checked still holds. When a Kiro sign-in poll gets no answer from Kiro Crew (the browser could not reach it, or a proxy answered 502, 503 or 504 without a code), the failure screen now says the connection was lost and to start over, instead of the browser's "Failed to fetch". Every answer the gateway itself gives keeps its own text: an expired code, a denied or failed sign-in, a forgotten sign-in id, and the coded 502 when the auth service is unreachable. Only the wording changes; the poll still stops on the first failure and Start over behaves as before. Both new tests turn red when their guard is removed. The rebase cleared the red backend shards of the old head, and every check on this head is green. Decisive lines: website/src/components/KasLoginGate.tsx:1232, website/src/components/KasLoginGate.tsx:718-724, website/src/api/queryClient.ts:50-54, src/kiro_crew/dashboard/handlers/kas_login.py:222-247
Problem / Motivation
Goal: When the gateway restarts or the connection to it drops while a Kiro sign-in waits for approval, the sign-in screen says the connection was lost and to start over, instead of the browser's raw "Failed to fetch".
Start a Kiro sign-in from the dashboard, then let the gateway restart before you approve it. The screen ends on "Sign-in failed" / "Something went wrong while waiting for approval" / "Failed to fetch". The onboarding bug bash hit this in 4 runs on 4 host shapes, Linux and Windows.
Why it matters
A brand-new user signing in for the first time is the one most likely to restart the gateway mid-sign-in. "Failed to fetch" names neither the cause nor the next step, so they cannot tell whether to wait, retry, or report a bug, and a moment that one click fixes reads as a broken product.
Not a goal
unknown_login_id) that a gateway already back up answers for a sign-in it forgot, keep their text.What changed (motivation → approach → change)
The sign-in screen printed whatever the failed poll said. When the gateway never answers (it is restarting, or the link to it dropped), that is the browser's own "Failed to fetch", which explains nothing.
KasLoginGate.tsxasks the existingisUnansweredReadcheck (a fetch rejection, or a 502/503/504) whether the poll got no answer. When it got none, and the response carries nocode, the screen reads "Sign-in failed" with the sentence "We lost the connection to Kiro Crew, which may have restarted. Start over to sign in again.", above the same Start over button. A coded answer keeps its own text. "Ask the agent" still hands over the original failure, through the report attached to the error.The sentence ships in every language under
website/src/i18n/locales/(components.kasLogin.connection_lost_body, English inen.manual.json), andkas-auth.mddescribes the screen.Backwards compatibility
Compatible: only the text of one failure screen changes; no API, config, catalog key or stored data is renamed or removed.
Removes nothing: the raw message is replaced only on a poll the gateway never answered, and the hand-off report still carries it.
Tests
website/src/components/KasLoginGate.test.tsx:TypeError('Failed to fetch')shows the connection-lost sentence, and "Failed to fetch" appears nowhere.auth_service_unreachable) keeps "Kiro auth service is unreachable." under the old headline.Proof: not provable -- frontend test (prove.py runs Python only)
Red before: with
KasLoginGate.tsxput back to its parent, the connection-lost test fails (Unable to find role="heading" and name "Sign-in failed") and the coded-502 test passes, which is its job: it guards against rewording every failure.Determinism: both new tests passed 20 repeated runs (
npx vitest run --maxWorkers=1 -t "never answered|coded 502 keeps" src/components/KasLoginGate.test.tsx), and the whole file passed in a shuffled order (--sequence.shuffle --sequence.seed=8716, 42 of 42).Manual verification
The built SPA from this head, served by
website/scripts/lib/serve-dist.mjswith every/api/**call stubbed: begin a Google device sign-in, then make the poll's request fail at the network layer (what a restarting gateway does), and separately answer it with the coded 502. Each frame was checked for its text before it was captured (below).Screenshots / video
Captured from this head's built SPA, poll forced to fail at the network layer (the restart case), dark and light:
Unchanged: a poll the gateway answered with its coded 502 keeps its own text under the old headline:
Related Issues
Closes #34681
Sibling sweep
Swept: git grep -nE "error??.message" -- website/src/components/KasLoginGate.tsx
Sibling: website/src/components/KasLoginGate.tsx:1157 -- not affected -- the status read's headline already says the status could not be checked, and Check again plus the 30 s refetch recover it; the begin error (line 1281) is the same: no sign-in is pending, and "Could not start sign-in" sits under the provider buttons that retry it
Pattern harvest
Not generalizable: the shared
isUnansweredReadcheck already names the no-answer class; whether a screen rewords it depends on what that screen can offer next, which no lint rule can read.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)