Repository navigation
test: pin the credit pill's fast-poll refetchInterval wiring - #25992
Conversation
First Principles Review (Opus 5.5) — ⏭️ skippedRevision |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing to check. The PR only adds a test file and changes nothing a user can see, so the missing screenshots leave no evidence gap. [UX-REVIEWED] 0b7e98f Description read[DESCRIPTION-READ] 7c3b9e5ae3a60fa8138c28fe7aaf4fb62a27615097032044d5ebd5a1c8f72edf That sha256 names everything this verdict read: the PR description, plus the 3 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 |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Test-only change. It adds a regression pin on the existing wiring, removes nothing and renders nothing new. [DESIGN-REVIEWED] 0b7e98f Description read[DESCRIPTION-READ] fcd3a0ece14250af8a28f253901acb0624b1cd3284488cdf9cdedb554b3e7319 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 — ✅ 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: |
kiroUsageRefetchInterval.test.ts covers the cadence helper as a pure function, but nothing covered that the credit pill's useQuery calls it. Swapping the wiring for refetchInterval: 30_000 kept every test green. Mount useKiroUsageReadout and read the interval its kiro-usage query resolves: the warming cadence for a null reading and for a failed read, the steady cadence once a reading lands. With the wiring swapped for 30_000, the two warming cases fail. Refs #25933
8b9d505 to
0b7e98f
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (1 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: test-only; pins the credit pill's fast-poll refetch interval wiring.
Problem / Motivation
Goal: A test fails if the Kiro credit pill stops polling fast while its reading is still warming.
#22387 made the credit pill re-poll quickly after a reopen:
website/src/shell/topbar/kiroUsageReadout.tsx:41passeskiroUsageRefetchInterval(...)as the['kiro-usage']query'srefetchInterval.kiroUsageRefetchInterval.test.tscovers that helper as a pure function, but nothing covers that the pill calls it. Swapping the wiring back torefetchInterval: 30_000keeps every test green (item 2 of #25933).Why it matters
Without a test on the wiring, a refactor of the hook can drop the fast poll silently, and a reopened pill goes back to a spinner that waits a full 30 seconds for each warming read.
Not a goal
kiroUsageRefetchInterval.test.ts, which fix(test): expect 'none' for API-key auth in the Kiro usage parser test #25944 is editing.What changed (motivation → approach → change)
helper pinned, wiring not → mount the real hook and read the interval its query resolves.
website/src/test/kiroUsageReadout.fastPoll.test.tsxmountsuseKiroUsageReadoutunder aQueryClientProviderwithapi.sessionsUsageandapi.kirocrewConfigmocked.refetchIntervalfor the['kiro-usage']query and resolves it against the live query:KIRO_USAGE_WARMING_POLL_MSfor a warming (null) reading and for a failed read,KIRO_USAGE_STEADY_POLL_MSonce a reading lands.Backwards compatibility
Compatible: test-only change; no product code is touched.
Removes nothing: one new test file, nothing else changes.
Tests
kiroUsageReadout.fastPoll.test.tsx, 3 tests:polls fast while the cache is still warmingpolls fast while the read fails before kiro-cli is readydrops to the steady cadence once a reading landsMutation: with lines 41-46 replaced by
refetchInterval: 30_000,, the two warming tests fail (expected 30000 to be 2500) and the steady one still passes. Restored, 3 passed.Repeats 10/10. Shuffled with
App.shell.owners.test.ts(seeds 4242, 77, 9001): 7 passed each.eslint,tsc -p tsconfig.app.jsonandnpm run buildpass.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
N/A — unit coverage sufficient; the mutation above is the check that the test pins the wiring.
Related Issues
Refs #25933
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; see the Licensing section of CONTRIBUTING.md.