Skip to content

fix(kas): translate the signed-out row an ACP error frame produces - #38144

Merged
bolichen97 merged 1 commit into
kirodotdev:mainfrom
JalaluddinYazdani:fix/38104-kas-signed-out-row-token
Nov 17, 2026
Merged

bolichen97 merged 1 commit into
kirodotdev:mainfrom
JalaluddinYazdani:fix/38104-kas-signed-out-row-token

Conversation

@JalaluddinYazdani

Copy link
Copy Markdown
Contributor

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_route compared the whole text with the sentence, so it never matched, recovery._terminal_error_meta stamped no kas_signed_out token, 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_out copy. 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 them
Reader: website/src/pages/chat/gatewayNotice.ts:copyOf -- chat -- renders the kas_signed_out catalog copy, which has no request-id placeholder; unchanged, already used for the failed-start row

Tests

  • 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_error from 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.
  • Red on unchanged main: assert {'kind': 'auth_required'} == {'kind': 'auth_required', 'notice': 'kas_signed_out', ...}, 6 failed.
  • Determinism: 20/20 at -n0; 10/10 at -n 4 --dist loadgroup --max-worker-restart=2 with test_acp_refactor_error_surface.py and test_agent_sdk_host_auth.py as co-tenants; shuffled run of both parity and error-surface files, seed 10030, 156 passed.
  • Local gate floor at exit 0: 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_error and _terminal_error_meta with 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_out notice (website/src/pages/chat/gatewayNotice.ts copyOf), 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license.

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
@github-actions github-actions Bot added the fork Pull request from a fork (external contributor) label Nov 16, 2026
@JalaluddinYazdani

Copy link
Copy Markdown
Contributor Author

@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.

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 16, 2026
@JalaluddinYazdani JalaluddinYazdani mentioned this pull request Nov 16, 2026
1 task done
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 16, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@bolichen97
bolichen97 enabled auto-merge (squash) November 16, 2026 23:09
@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 1854e999a3044b275431e77ccf260db5545aec52 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 1854e999a3044b275431e77ccf260db5545aec52 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The prefix match lets the translated copy drop the "Switching models will not help" note and the request id that the error formatter appends. If that tail is ever needed for support, the rendered row can't show it. Only the stored text and the Slack mirror keep it.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 1854e999a3044b275431e77ccf260db5545aec52 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. This is a mechanism-level fix with a reproducing test, and its one recogniser has one consumer (recovery.py:376).

What this change ships

Inventory (4 items) — 4 justified

Intent: 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.

  1. A signed-out row raised mid-prompt by an ACP error frame now renders the translated kas_signed_out copy, with its route — justified
  2. That rendered row no longer shows the "Switching models will not help" note or the request id; the stored text and the Slack mirror still carry both — justified
  3. The recogniser accepts the sentence only when it leads the text, so the same sentence quoted inside other prose still keeps its English — justified
  4. The kas-auth spec now says what counts as a leading sentence — justified

[FIRST-PRINCIPLES-REVIEWED] 1854e99

Description read

[DESCRIPTION-READ] 3e3bf8620bf6816abd3d9bbc693f29d191c2a6a35cd2f04086c93fdb4f580fbc

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 1854e999a3044b275431e77ccf260db5545aec52 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1854e99

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 1854e999a3044b275431e77ccf260db5545aec52 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1854e99

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 17, 2026
@bolichen97
bolichen97 merged commit 8213131 into kirodotdev:main Nov 17, 2026
93 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants