Repository navigation
fix(kas): translate the signed-out row an ACP error frame produces - #38144
bolichen97 merged 1 commit into
Conversation
When KAS answers a prompt with a sign-in refusal, the ACP error formatter writes the KAS signed-out sentence and appends "Switching models will not help ..." and, when the frame has one, the request id. kas_signed_out_route matched the sentence only exactly, so that row got no kas_signed_out notice token and stayed English in every dashboard language, beside a translated Sign in button. The recogniser now accepts the sentence when it leads the row, alone or followed by more text after a space. The row's own text is unchanged; the translated copy leaves the appended tail out. Part of kirodotdev#38104
|
@bolichen97 could you review this one? It is part of #38104: the KAS signed-out row an ACP error frame produces was never translated, because the error formatter appends a note and the request id after the sentence the recogniser matched exactly. Backend-only, one commit, with a test that fails on main. The fork account cannot request reviewers or assign, so asking here. |
bolichen97
left a comment
There was a problem hiding this comment.
Approving 1854e99. kas_signed_out_route now accepts the signed-out sentence when the ACP error formatter appends its model-switch note and request id, through _leads_with (the whole sentence, then a space), so an unrelated sentence that only shares a prefix is still not translated. The translated copy drops the tail while the row keeps it, as the docstring and kas-auth.md say. Locally: test_transient_notice_parity.py and the host-auth suites, 104 passed. Held fork CI runs approved; auto merge is on.
AI-assisted, sent by Bolin Review bot
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the recogniser now matches the error-frame row by its leading sentence, it only accepts more than before, and it renders through copy that already exists. Notes
[DESIGN-REVIEWED] 1854e99 Description read[DESCRIPTION-READ] df1cef31c6000ef0ea9e6ea955ed96e6a9c065f10af1266bc9ac9eb9d15c4bb2 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, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a mechanism-level fix with a reproducing test, and its one recogniser has one consumer ( What this change shipsInventory (4 items) — 4 justifiedIntent: a user whose dashboard is not in English sees the "Not signed in to Kiro" row from a refused KAS prompt in their own language. FIX.
[FIRST-PRINCIPLES-REVIEWED] 1854e99 Description read[DESCRIPTION-READ] 3e3bf8620bf6816abd3d9bbc693f29d191c2a6a35cd2f04086c93fdb4f580fbc That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Problem / Motivation
Goal: The "Not signed in to Kiro" row that a KAS sign-in refusal produces mid-prompt shows in the dashboard's own language, like the same row from a failed start already does.
On a dashboard set to a language other than English, a KAS prompt refused for a missing sign-in ends on an English error row beside a translated Sign in button. #38104 shows it in Portuguese: the English sentence, then "Entrar no Kiro".
Why it matters
This row is often the first thing a new Kiro Agent user sees, and it tells them exactly what to do. In 11 of the 12 dashboard languages that instruction arrives in English.
Not a goal
What changed (motivation → approach → change)
Symptom: the row stays English. Cause: the ACP error formatter's sign-in branch writes the KAS signed-out sentence, then appends "Switching models will not help ..." and the request id.
host_auth.kas_signed_out_routecompared the whole text with the sentence, so it never matched,recovery._terminal_error_metastamped nokas_signed_outtoken, and the frontend's fallback (which needs the text to end with the sentence) missed too.Change: the recogniser accepts the sentence when it leads the row, alone or followed by more text after a space. The row now carries the token and its route, as a failed start's row does.
User-visible change, in every language including English: the rendered row is the existing
kas_signed_outcopy. It names the route in plain words and leaves out the model-switch note and the request id. The row's stored text keeps both.Backwards compatibility
Compatible: every text the recogniser accepted before it still accepts with the same answer; it only also accepts the sentence followed by more text.
The rendered row no longer shows the appended note and request id:
Reader: src/kiro_crew/dashboard/chat_turn/turn_failures.py:_on_auth_required -- chat -- the row's content and the Slack mirror (
_deliver_linked_slack_message) still carry the full English text with the request id; test_kas_signed_out_error_frame_row_carries_the_token asserts the text keeps themReader: website/src/pages/chat/gatewayNotice.ts:copyOf -- chat -- renders the
kas_signed_outcatalog copy, which has no request-id placeholder; unchanged, already used for the failed-start rowTests
test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token(6 cases: no route, relay, bundle, each with and without a request id). It raises the row through_raise_acp_errorfrom kiro-cli's own "Not logged in" frame and asserts the row meta is{"kind": "auth_required", "notice": "kas_signed_out"}plus the route, that the row text keeps the note and the request id, and that the sentence quoted after other prose is not recognised.assert {'kind': 'auth_required'} == {'kind': 'auth_required', 'notice': 'kas_signed_out', ...}, 6 failed.-n0; 10/10 at-n 4 --dist loadgroup --max-worker-restart=2withtest_acp_refactor_error_surface.pyandtest_agent_sdk_host_auth.pyas co-tenants; shuffled run of both parity and error-surface files, seed 10030, 156 passed.scripts/local-gate.py(backend related: 3007 passed, 18 skipped; frontend related: 530 files, 15732 tests passed), black,check_black_formatting.py,check_subprocess_encoding.py, isort, flake8,mypy --platform linux,check_comment_history.py,check_brand_name.py,check_file_line_cap.py,test_flake_pattern_ratchet.py. semgrep is not installed locally; CI's SAST job runs it.Proof: PROVEN test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token[-None-None], test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token[-route1-relay], test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token[-route2-bundle], test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token[4f2a-77-None-None], test/test_transient_notice_parity.py::test_kas_signed_out_error_frame_row_carries_the_token[4f2a-77-route1-relay] (head 1854e99)
Manual verification
A throwaway script fed the relay's refusal frame (
-32000 Authentication required. Not logged in. ... kiro-cli login ...) through_raise_acp_errorand_terminal_error_metawith the relay as the last route. Before:{'kind': 'auth_required'}. After:{'kind': 'auth_required', 'notice': 'kas_signed_out', 'notice_args': {'route': 'relay'}}, the same meta the failed-start path produces.The rendered row was not checked in a browser. Producing a real refusal on this machine would mean signing out the host's kiro-cli.
Screenshots / video
Why no screenshot: The diff is backend-only and adds no UI; the row now renders through the existing
kas_signed_outnotice (website/src/pages/chat/gatewayNotice.tscopyOf), the copy a failed start's sign-in row already shows.Related Issues
Part of #38104
Related: #34690, #32065, PR #35787.
cc @bolichen97 for review.
Sibling sweep
Swept: git grep -nE "kas_signed_out_route|_KAS_SIGNED_OUT|signed_out_message(ACP_BACKEND_KAS)|legacyKasSignedOutRoute" -- src website/src
Sibling: src/kiro_crew/agent_sdk/host_auth.py -- changed here
Sibling: website/src/pages/chat/gatewayNotice.ts -- not affected -- its fallback reads only token-less rows, and the side panel writes the bare sentence
Sibling: src/kiro_crew/dashboard/chat_threads.py:1255 -- not affected -- writes the bare sentence with no suffix
Pattern harvest
Rule candidate: review-prompt
Pattern: a recogniser that compares a whole text with a sentence another formatter appends to
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.