Repository navigation
fix: lead network failures in kas login and install with the cause - #33713
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change only rewords three messages and is easy to revert. The cause is read from the exception types, with the library's text kept as the fallback. Notes
[DESIGN-REVIEWED] 6e9c189 Description read[DESCRIPTION-READ] 366a637ccc335c7255c2fa889e0e6ac1b3d48956972c930c9bdfb734eba8b647 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 This fix is aimed at the real cause: both messages printed the library's exception text. The new helper has two real consumers, and the five unfixed sibling messages are declared and tracked in #33608. What this change shipsInventory (5 items) — 5 justifiedIntent: a new user on a blocked network should learn which host failed and why, in plain words. This is a FIX for #31920.
[FIRST-PRINCIPLES-REVIEWED] 6e9c189 Description read[DESCRIPTION-READ] a0df2128eb63996aaa94169a1de35c904d755a1d84ff0e863c86b93dc72ff679 That sha256 names the PR description this verdict read. 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: |
buluoray
left a comment
There was a problem hiding this comment.
Approving. When kas login or the KAS engine manifest fetch fails, the error now names the host and a plain cause (refused / unresolved / timed out), read from the exception types (asset_downloader.py:351-364, cli_kas_login.py:211-230, kas_bundle.py:383-386). Other failures keep the library text, and exit codes and exception types do not change. The current reds are rate limits and a GitHub 504 during setup, not findings; they need a rerun.
`kirocrew kas login` and the KAS engine manifest fetch printed the raw aiohttp / urllib exception text when a host did not answer (`ssl:default [Multiple exceptions: [Errno 111] ...]`, `<urlopen error [Errno 111] Connection refused>`), so a new user could not tell their network from a Kiro Crew bug. Both now name the host and the cause in plain words: connection refused, the host name could not be resolved, or timed out, read from the exception types by a shared asset_downloader helper. The sign-in messages add what to do next. Any other failure keeps the library text. Closes #31920
fe6e9d7 to
6e9c189
Compare
|
Rebased: main moved in
|
buluoray
left a comment
There was a problem hiding this comment.
Approve on 6e9c189. Pure rebase of the previously approved head fe6e9d7 onto newer main; every added/removed line is identical (only diff context differs), tests 110/110 green, two mutations each redden a named test; all red checks are GitHub API rate-limit infra. Decisive lines: src/kiro_crew/asset_downloader.py:352, src/kiro_crew/cli_kas_login.py:221, src/kiro_crew/acp/kas_bundle.py:394
Problem / Motivation
Goal: When
kirocrew kas loginor the KAS engine download cannot reach its host, the error names the host and the cause in plain words instead of Python's exception text.With the sign-in service unreachable,
kirocrew kas loginprints❌ could not reach the sign-in service: Cannot connect to host oidc.us-east-1.amazonaws.com:443 ssl:default [Multiple exceptions: [Errno 111] Connect call failed ...]. With the engine host unreachable, the one-line installer prints❌ could not fetch https://kas.crew.kiro.dev: <urlopen error [Errno 111] Connection refused>.Why it matters
Both lines are what a new user sees on a fresh machine when the network or a firewall is in the way.
ssl:default [Multiple exceptions: ...]and<urlopen error ...>are Python internals: the user cannot tell whether it is their network, their proxy or a Kiro Crew bug, and the sign-in line never says to check the network.Not a goal
HTTPS_PROXYtoday (fix: send sign-in and refresh requests through the configured proxy #31966 works on that), so these messages do not tell the user to set it.kirocrew update, memory forget, the policy fetch, pinned downloads): tracked in More network failure messages still show raw exception text (update, memory forget, policy fetch, pinned downloads) #33608.What changed (motivation → approach → change)
kirocrew kas login❌ could not reach the sign-in service: Cannot connect to host oidc.us-east-1.amazonaws.com:443 ssl:default [Multiple exceptions: ...]❌ could not reach the sign-in service (oidc.us-east-1.amazonaws.com): connection refused.Nothing was stored. Check your network connection, then run the command again.acp/kas_bundle.py:kirocrew kas install, the installer, the dashboard and spawn installs)❌ could not fetch https://kas.crew.kiro.dev: <urlopen error [Errno 111] Connection refused>❌ could not download the KAS engine from https://kas.crew.kiro.dev: connection refusedBoth messages printed the library exception's own text, which is written for a Python developer, not for the person running the command.
A small helper,
asset_downloader.network_failure_cause, names the three causes a user can act on:connection refused,the host name could not be resolvedandtimed out. It reads them from the exception types (urllib'sURLError.reason, aiohttp'sClientConnectorError.os_error), never from the text. Both sign-in messages (starting a sign-in, and losing contact while waiting for approval) name the host aiohttp reports and say what to do next; aiohttp's connect timeout carries no host, so its own text (Connection timeout to host <url>) stays the reason there. The engine message says what was being downloaded; the dashboard and spawn installs show it inside their ownKiro Crew could not install its KAS engine: ...line. Any other failure still shows the library's text, which is then the only clue there is.error-handling.mdgets one Boundaries row for this rule.Backwards compatibility
Compatible: only the wording of these failure messages changes. Exit codes, exception types and callers are the same, and nothing reads the old text (the cloud sign-in parser reads only the
Openandcode:lines).Removes nothing: no path, record, key or function is taken away; three message strings are reworded.
Tests
test/test_cli_kas_login.py::TestLogin::test_an_unreachable_sign_in_service_names_the_host_and_the_cause: the reported aiohttp shape (both addresses refused) prints exactly the host,connection refusedand the next step.test/test_cli_kas_login.py::TestLogin::test_a_connect_timeout_keeps_the_host_its_text_names: a connect timeout, which has nohost, keeps the text that names the host instead of a baretimed out.test/test_kas_bundle.py::TestManifest::test_an_unreachable_host_is_named_with_the_cause_in_plain_words: a refused, an unresolved and a timed-out urllib failure each give the plain cause.test_fetch_from_a_malformed_url_is_a_refusal_not_a_tracebackmatches the new lead; an unparseable url still keeps urllib's own text.-n0and 10 runs at-n 4 --dist loadgroupbesidetest_kas_route.py, and both touched test files (107 tests) passed in a shuffled order (seed 27471).Proof: PROVEN test/test_cli_kas_login.py::TestLogin::test_an_unreachable_sign_in_service_names_the_host_and_the_cause, test/test_cli_kas_login.py::TestLogin::test_a_connect_timeout_keeps_the_host_its_text_names, test/test_kas_bundle.py::TestManifest::test_fetch_from_a_malformed_url_is_a_refusal_not_a_traceback, test/test_kas_bundle.py::TestManifest::test_an_unreachable_host_is_named_with_the_cause_in_plain_words[reason0-connection refused], test/test_kas_bundle.py::TestManifest::test_an_unreachable_host_is_named_with_the_cause_in_plain_words[reason1-the host name could not be resolved] (head 6e9c189)
Manual verification
kirocrew kas install --url https://127.0.0.1:1and--url https://kas.nonexistent.invalid(isolatedKIROCREW_HOME, Linux):❌ could not download the KAS engine from https://127.0.0.1:1: connection refusedand... from https://kas.nonexistent.invalid: the host name could not be resolved, exit 1._run_device_loginwith the issuer url pointed athttps://127.0.0.1:1and athttps://oidc.nonexistent.invalid):❌ could not reach the sign-in service (127.0.0.1): connection refused.and(oidc.nonexistent.invalid): the host name could not be resolved., each followed by the next-step line, exit 1.Screenshots / video
N/A — terminal text only; no frontend file changes.
Related Issues
Closes #31920
Sibling sweep
Swept: git grep -nE "(could not|cannot|failed to) (reach|fetch|connect|download)[^"]{exc}" -- 'src/kiro_crew/.py' ':!src/kiro_crew/apps/builtins/'
Sibling: src/kiro_crew/cli_kas_login.py:300 -- changed here
Sibling: src/kiro_crew/platform/wheel_engine_transfer.py:155 -- tracked in #33608
Sibling: src/kiro_crew/memory_forget_client.py:158 -- tracked in #33608
Sibling: src/kiro_crew/platform/policy_distribution.py:369 -- tracked in #33608
Sibling: src/kiro_crew/platform/policy_distribution_boot.py:486 -- tracked in #33608
Sibling: src/kiro_crew/asset_downloader.py:1045 -- tracked in #33608
Sibling: src/kiro_crew/coder/session_browse.py:219 -- not affected -- the text is the remote worker's own error message, not a socket exception
Pattern harvest
Rule candidate: review-prompt
Pattern: a user-facing network failure message that interpolates the raw exception (
{exc}) instead of naming the cause throughasset_downloader.network_failure_cause.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.