Repository navigation
Conversation
When Crew's sign-in vault holds a usable Kiro identity, /api/sessions/usage now reads GetUsageLimits directly with the vault's OIDC access token (resolved and refreshed through KasAuthProvider) instead of requiring kiro-cli. The kiro-cli readiness gate is skipped on that path, since it exists only to stop a signed-out kiro-cli spawn from opening a browser login; no kiro-cli is spawned. The vault is authoritative once it holds an identity: a failure reports unavailable (signin_required when auth-class) rather than falling back to kiro-cli's possibly different account. A reading is published only when the vault identity fingerprint read before the credential matches the one read after the API answers, and a stale reading is kept only for the same vault identity. Without a vault identity the existing kiro-cli path is unchanged.
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (5 items) — 3 justifiedIntent: show the credit usage pill for a Crew-sign-in user with no kiro-cli installed. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 2efb9ad Description read[DESCRIPTION-READ] 04256be5c17ec0b6a1c5a2f9bedeffdc10961a9fbda5ec4605ca4d8b43b3a179 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The vault takes over usage for every backend, not only the one that uses it, so a kiro-cli user with a leftover Crew sign-in sees another account's credits. Watch
[DESIGN-REVIEWED] 2efb9ad Description read[DESCRIPTION-READ] 8ee86f4da43547dc0d65d1ffeecef7f497ae886485e5938e35e9fd3160620fb3 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 |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed Review detailsUsage pill can show the Crew sign-in vault's account instead of the account the selected backend runs on. FINDING — src/kiro_crew/dashboard/handlers/sessions.py:1155 — [OPUS-REVIEWED] 2efb9ad |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/handlers/sessions.py:1481 -- Concurrent vault logout bypasses the CLI readiness guard [BLOCK-MERGE] 2efb9ad Adjudication (Opus 5.5) — is blocking on each finding proportionate?I flagged the one fenced finding (F1). It still blocks the merge; the flag only gives a repository writer a ready-made rationale if they choose to override it. There were no adjudicable findings to rule on, so the main footer is empty. F1 (fenced): FLAG. The race is real, but the consequence is a single visible browser login that fixes itself on the next poll. No credential is exposed and no governance ceiling is bypassed. Conditions (the changed lines come from the patch, since this checkout is the base):
Recovery: On the next poll the vault is empty, so [ADJUDICATION] 2efb9ad total=0 uphold=0 downgrade=0 [ADJUDICATION-FENCED] 2efb9ad fenced=1 flagged=1 🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override recorded by a repository writer, who must independently verify a rationale before recording it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop. (This lane's comment deliberately carries no override command.)
|
|
Superseded by #21956: same change, reopened as a same-repo branch and rebuilt on current main with this PR's review findings addressed (harness-scoped vault ownership, no kiro-cli fallback after a vault verdict, one shared GetUsageLimits helper). |
Summary
With KAS on Crew's own sign-in and no kiro-cli installed,
/api/sessions/usagereturned 503kiro_prerequisite_requiredand the credit pill went blank, even though Crew already holds a working OIDC token.kiro_usage_api.fetch_usage_limits_with_credential(token, profile_arn): GetUsageLimits with one caller-supplied credential. Same never-raise /AUTH_*contract asfetch_usage_limits; uses the stored ARN, ListAvailableProfiles only for the display name (or the ARN when none is stored)._fetch_usage_bgtries_refresh_from_vault()first: when the vault holds a usable identity, the token is resolved and refreshed throughKasAuthProvider(allow_env_api_key=False)and the API is called directly. No kiro-cli is resolved or spawned./api/sessions/usageand POST/refreshis skipped when the vault owns usage. That gate only exists to stop a signed-out kiro-cli spawn from opening a browser login.signin_requiredwhen auth-class) and never fall back to kiro-cli, whose login may be a different account.kiro_crew.authimports stay deferred to call time (boot-path / cryptography gates).Without a vault identity, behavior is unchanged.
Testing
test/test_usage_crew_vault.py(13 tests): vault publish without kiro-cli, fall-through when no vault identity, identity change mid-refresh, auth-rejected and token-refresh failures reportsignin_requiredwithout falling back, same-identity stale preservation, no preservation of a kiro-cli reading, gate bypass and gate retention, and the single-credential client (ARN payload, 401, transport error, empty token).test_usage_crew_vault.py,test_session_usage.py,test_kiro_usage_api.py,test_kiro_spawn_readiness_gate.py,test_kas_login_api.py,test_approval_chain_no_cryptography.pypass; isort, flake8, mypy (touched files), black baseline gate and sync-io gate pass.