Repository navigation
fix: keep the kiro credit pill on the default harness when a read fails - #31459
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: swapping Notes
[DESIGN-REVIEWED] e6725f6 Description read[DESCRIPTION-READ] ce7317f7e626b566386f65904ab795fcfdc48442693b97647f36b02c34914e07 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 The fix swaps in the existing Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: let a default-install (KAS) user whose credit read fails still see the failure and open the Kiro Account modal. FIX.
[FIRST-PRINCIPLES-REVIEWED] e6725f6 Description read[DESCRIPTION-READ] 70dcc44854f583f8894ac47fc60272b1d31bd7c5c59682867867fb59af5ac6b1 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The PR only widens where an existing pill and modal appear. Screenshots shot-02 and shot-03 show both on KAS, and the blind reader linked the pill to the "Kiro Account" modal by its shared icon. Notes
[UX-REVIEWED] e6725f6 Description read[DESCRIPTION-READ] 59ce0179fea9419c80325a1f49894ad418b536a9de8d06b9df5da852d20eac9f That sha256 names everything this verdict read: the PR description, plus the 7 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: |
0e6494b to
3c0454b
Compare
|
Rebased: main moved in docs/system-specs/modules/ (acp-client.md, cli.md, security.md and 78 more same-dir files) since this head went green (b764e20 -> aca93ab); CI re-running. The base now carries #31469, which clears the security package line-budget red both backend shard 2 jobs hit on the previous head. [operator: bolichen97] |
3c0454b to
d70e9be
Compare
|
Rebased: main moved in docs/system-specs/modules/learn-cron-dashboard.md (and 48 more same-dir files under docs/system-specs/modules/) since this head went green (aca93ab -> f9e8bdf); CI re-running. The changed lines are byte-identical to the previous head; the previous head's AI review, policy and readiness lanes stopped on an exhausted CI API rate limit, so they had no verdict to keep. [operator: bolichen97] |
The top-bar credit surface was keyed on the kiro-cli backend alone, so on KAS, the default harness and one that draws on the same Kiro account, a failed usage read hid the segment and left no way into the account modal. Decide the surface by the Kiro harness set (kiro-cli and KAS) instead, so the failed read keeps its "unavailable" dash and modal there, while other harnesses still hide it. Closes #29795
d70e9be to
e6725f6
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on e6725f6, no conflict, no open change request.
…ls (#31459) The top-bar credit surface was keyed on the kiro-cli backend alone, so on KAS, the default harness and one that draws on the same Kiro account, a failed usage read hid the segment and left no way into the account modal. Decide the surface by the Kiro harness set (kiro-cli and KAS) instead, so the failed read keeps its "unavailable" dash and modal there, while other harnesses still hide it. Closes #29795 (cherry picked from commit 963d468) Co-author on main: Bolin Chen
…ls (#31459) The top-bar credit surface was keyed on the kiro-cli backend alone, so on KAS, the default harness and one that draws on the same Kiro account, a failed usage read hid the segment and left no way into the account modal. Decide the surface by the Kiro harness set (kiro-cli and KAS) instead, so the failed read keeps its "unavailable" dash and modal there, while other harnesses still hide it. Closes #29795 (cherry picked from commit 963d468) Co-author on main: Bolin Chen
…ls (#31459) The top-bar credit surface was keyed on the kiro-cli backend alone, so on KAS, the default harness and one that draws on the same Kiro account, a failed usage read hid the segment and left no way into the account modal. Decide the surface by the Kiro harness set (kiro-cli and KAS) instead, so the failed read keeps its "unavailable" dash and modal there, while other harnesses still hide it. Closes #29795 (cherry picked from commit 963d468) Co-author on main: Bolin Chen
Problem / Motivation
Goal: On the default KAS harness, a failed credit read keeps the top-bar credit pill as an "unavailable" dash that opens the Kiro Account modal, as it already does on kiro-cli.
On a default install (KAS harness), when
GET /api/sessions/usagefails (a 503), the top bar shows no credit pill at all: no error state and no way into the account modal. The same failure on the kiro-cli harness shows the "—" dash labelled "Kiro account & credits — unavailable", and the modal behind it.Why it matters
KAS is the harness every install runs when it holds no choice, and it bills the same Kiro account as kiro-cli. Every such user whose usage read fails loses the only surface that reports the failure and the desktop's only door to the account modal (Refresh, switch account, manage subscription). The phone drawers' Kiro Account entry follows the same rule, so phone users lose it too.
Not a goal
kiro_prerequisite_required, the second report on the issue. That 503 is also what the gateway answers while it boots, so relabelling it needs its own decision; this PR makes the pill and its modal reachable there.What changed (motivation → approach → change)
Symptom: on KAS a failed usage read hid the credit segment. Cause:
shell/topbar/kiroUsageReadout.tsxdecided whether the Kiro credit surface exists withisKiroBackend, which is true for kiro-cli only, so KAS was treated like a harness with no Kiro balance and itsfailedstate was hidden.Change: the surface is decided by
isKiroHarnessinstead, the existing positive check for the Kiro harness set (kiro-cli and KAS,KIRO_HARNESS_BACKENDSinapi/acpBackend.ts). On KAS a failed read now keeps the "unavailable" dash and its modal, an empty reading keeps the "no reading" dash with Refresh, and the phone drawers keep the Kiro Account entry, exactly as on kiro-cli. Every other harness hides the segment as before, and an unloaded config still renders no dash.The comments that described the old rule (
kiroUsageReadout.tsx,api/kiroUsage.ts,api/acpBackend.ts,components/KiroAccountModal.tsx, theapi/acpBackend.test.tsheader), the phone-drawer paragraph inwebsite/docs/narrow-viewport.md, and the account-modal sentence indocs/system-specs/modules/learn-cron-dashboard.mdsay "a Kiro harness" (isKiroHarness) where they said kiro-cli (isKiroBackend).Backwards compatibility
Compatible: the credit segment now appears on KAS where it was hidden; nothing that renders today stops rendering.
Removes nothing: the only behaviour change adds a surface on KAS; the hide rule for non-Kiro harnesses is unchanged.
Tests
website/src/test/App.creditPillError.test.tsx:kiroandkas(it.each): a 503 usage read renders the dash labelled "unavailable", and clicking it opens the account modal in its unavailable state.kiroandkasthe same way.claudeinstead ofkas, since KAS is a Kiro harness; their assertions are unchanged.Both
kascases are red withkiroUsageReadout.tsxreverted toorigin/mainand green with the fix; thekirocases are green on both. The file passed 20 runs, each in a shuffled order (--sequence.shuffle, seeds 1037 to 1740 in steps of 37).Related frontend specs (
App.mobileSingleTopbar,App.topbarAndShortcuts,App.topbarCapsule,kiroUsageReadout.fastPoll,KiroAccountModal*,stubDashboardApiConfigFixture,shell-notifications.locations) pass;tsc -p tsconfig.app.jsonand eslint pass.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Built the SPA from
origin/mainand from this branch and drove both with Playwright behind the gateway-free loopback server and API stub (scripts/lib/serve-dist.mjs,scripts/lib/stub-dashboard-api.mjs), with/api/sessions/usageanswering 503kiro_prerequisite_required:acp_backendkaskasclaudeScreenshots / video
Before, KAS, usage read failing: no credit pill in the capsule.
After, KAS, same failure: the "—" dash sits in the capsule.
After, the dash opens the account modal in its unavailable state, with Refresh.
After, Claude Code harness, same failure: still no credit pill.
Related Issues
Closes #29795
Sibling sweep
Swept: git grep -n "isKiroBackend" -- website/src
Sibling: website/src/api/kiroUsage.ts:114 -- changed here
Sibling: website/src/components/KiroPrerequisiteGate.tsx:849 -- not affected -- a comment naming where the definition lives, no surface decision
Sibling: website/src/pages/settings/KiroHarnessFallbackNote.tsx:14 -- not affected -- already reads isKiroHarness, so KAS is covered
Pattern harvest
Not generalizable:
isKiroBackendis the right check for kiro-cli-only behaviour, and whether a surface belongs to kiro-cli or to the Kiro account is a per-surface judgement no rule can make.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)