Repository navigation
Conversation
`recencyEpoch` is documented as a ladder -- last activity, else last message,
else created -- but reads it with `??`. The backend spells "no activity yet"
as the EMPTY STRING: `SlotProjection.to_dict` initialises
`last_activity_ts = ""` and assigns it only when its reverse walk finds an
`assistant`/`tool_call`/`tool_result` row that is not a system notice, then
ships the key unconditionally. `??` only falls through on null/undefined, so
for every projected slot the ladder stopped on its first rung and neither
fallback was ever read.
A session whose transcript holds only the user's own prompt therefore scored 0
and sorted below sessions untouched for weeks -- at the one moment the
quick-switcher is used most -- and its row rendered with no relative time,
because `fmtRelativeTime("")` resolves to undefined. Every empty "+ New
Session..." slot scored 0 too, so the surviving row was the first one in the
array rather than the most recently created one the function documents.
Read the ladder with `||` at the three sites that share the expression, so ""
falls through exactly as an absent key already did. `slotActivityTs` in
`pages/chat/sessionOrder` reads the same wire rows with `||`; the sidebar and
the palette now agree on what "no activity yet" means. Which field the palette
ranks on is unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Design Review (Fable 5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 22ed047 |
GPT 5.6 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed |
First Principles Review (Fable 5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The palette still ranks on Verified against base: What this change shipsInventory (4 items) — 4 justifiedIntent: make the Command Palette's Current group rank a just-prompted session first instead of last — a FIX.
[FIRST-PRINCIPLES-REVIEWED] 22ed047 |
UX Review (Fable 5, fork) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK cannot evaluate: missing a screenshot of the fixed palette — the PR's entire on-screen delta (row order, new timestamp) is shown nowhere. Evidence gaps
[UX-REVIEWED] 22ed047 |
|
Closing: superseded by PR #12620 (604e6ac), which is already on main Thanks for the careful diagnosis. PR #12620 (merged 2026-09-23, squash 604e6ac) fixed the same root cause: the wire sends
Main also fixes the case this PR declared out of scope. One thing main doesn't have, though it isn't enough to keep this PR open: two of your tests have no literal counterpart there.
Both tests pass against main without changes. If you'd like them in, a small test-only PR against main would be welcome. If this PR still does something I've missed, please reply here or reopen it. From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong. |
Problem / Motivation
Open the Command Palette (⌘K / Ctrl+K) right after sending a prompt and the
session you are working in is at the bottom of the Current group, under
sessions nobody has touched for weeks, with no timestamp on its row.
recencyEpochin the recents provider is documented as a ladder — "lastactivity, else last msg, else created" — but it is written with
??:The backend spells "no activity yet" as the empty string, not as an absent
key.
SlotProjection.to_dictinitialiseslast_activity_ts = ""(
src/kiro_crew/dashboard/slot_projection.py:155) and assigns it only when itsreverse walk finds an
assistant/tool_call/tool_resultrow that is not asystem notice (
:160-166). The key is then shipped unconditionally(
:284), so every projected slot carries the field, and??— which onlyfalls through on
null/undefined— stops on the first rung for all of them.Neither
last_tsnorcreatedis ever read;if (!t) return 0then catches the""and the slot scores 0.Three call sites read that same expression, and all three are wrong in the same way:
last_activity_tsis""recentsProvider.ts:160recencyEpochrecentsProvider.ts:308rowtimestampfmtRelativeTime("")→toDatereturnsnull→ the row renders no time at allCommandPalette.tsx:358liveFingerprint"", so the open palette stops revalidating as that session's rows arriveWhich sessions carry
""is not a one-frame race:worked in right now, or a queued prompt that has not started;
them), e.g. one that failed on its first turn. That state is permanent, not
transient;
last_tsis""too andcreatedis the only instant it has — which is exactly the value
prepareCurrentSlotsdocuments itself as using ("keep at most ONE empty-new slot, the most
recent"). Under
??every such slot scores 0, the comparator returns 0 forevery pair, and a stable sort hands back whichever one happened to arrive
first.
Why it matters
The Current group is a quick-switcher: its whole job is to put the session you
were last in at the top, so ⌘K + Enter resumes it. A session ranks 0 precisely
while it is most active — between the user's prompt and the agent's first row —
so the ranking inverts at the one moment the switcher is used most, and the row
also loses the relative time a reader would use to spot it manually.
The bug is invisible to the existing tests because they omit
last_activity_tsentirely, and on an absent key
??and||agree. Only the""the wireactually sends separates the two readings.
What changed (motivation → approach → change)
Symptom: the palette's Current group ranks a just-prompted session last and
renders it without a timestamp. Root cause: a nullish-coalescing ladder over a
wire field whose producer's "absent" sentinel is
"", which makes every rungbelow the first dead code. Change: read the ladder with
||at all three sites,so
""falls through exactly as an absent key already did.pages/chat/sessionOrder.tsalready reads these same wire rows correctly —slotActivityTsislast_turn_ts || last_ts || created— so the sidebar and thepalette now agree about what "no activity yet" means instead of disagreeing.
That is the whole change: no field is added, no ranking key is swapped, and a
slot that genuinely has no instant at all still scores 0 and still sorts last.
Not in scope, deliberately: which field the palette ranks on
(
last_activity_tsvs the sidebar's settledlast_turn_ts) is a productquestion about churn while an agent works, and this PR does not touch it.
#10950 is a separate defect in separate files (
SessionGridView.tsx,ArtifactDetailPage.tsx) — comparing instants as text — with no file, hunk orroot-cause overlap with this one.
Tests
website/src/components/commandPalette/providers/recentsProvider.test.ts, threecases, each seeding the
""the producer actually sends:ranks an empty-string slot on its last_ts, not below every other row—a session last active two days ago vs one prompted today whose only row is
that prompt (
last_activity_ts: '', reallast_ts). Red-before the order is['stale', 'live']; after,['live', 'stale'].falls through to created when the slot has no timestamps at all— threeempty-new slots with
last_activity_ts: '',last_ts: ''and differentcreated. Red-before the survivor is'a'(input order, every score 0);after it is
'b', the most recently created — the rowprepareCurrentSlotsdocuments itself as keeping.
timestamps a row whose last_activity_ts is the empty-string sentinel—two rows describing the same instant reached two ways: one with the backend's
filled
last_activity_ts, one with""plus that instant inlast_ts. Theassertion is that the two rows carry the same timestamp, which keeps it
free of the app language and of how long ago the instant is when the suite
runs. Red-before the second is
undefined.Red-before at this branch's base (
f4cbf1021), production hunks reverted:3 failed | 32 passed, failing exactly as quoted above. Green-after:
122 passed across
recentsProvider.test.ts,recentsProvider.cov80.test.tsxandCommandPalette.test.tsx. Wider run oversrc/apps/command-bar,src/components/commandPalette,CommandPalette.test.tsx,QuickSearchSurface.test.tsx,switchSlotCallsiteClassification.test.ts,paletteNavLeaveGuard.test.tsx,MemoI18nSubscriptionRatchet.test.tsanduseWebSocket.thinkingStatusChurn.test.ts: 607 passed, 1 failed.That one failure is
settingsRegistry.test.ts's byte-for-byte check ofsrc/kiro_crew/docs/settings-registry.generated.json. It is a line-endingartifact of this Windows checkout — the file is CRLF on disk while
generateAgentRegistryJsonemits LF — and it is unreachable from this diff: thetest imports
scripts/settingsExtract,subNavParamsandsettingsRegistry.genand has no import path to either changed module. Not this branch's regression,
and not repaired here.
tsc -p tsconfig.app.jsonclean;eslintclean on all three changed files.Manual verification
The unit tests assert both observables at the provider boundary — the ordered
slot list and the row's
timestampfield — so the fix itself is covered withouta rendered frame. What they cannot show is the frame a user actually sees, which
is what the UX review asked for, so the Current group was also captured from the
running component (below).
Capture path, so the frame can be reproduced or disbelieved: an isolated Vite
entry mounts the real
CommandPalette(open, unscoped, empty query — thequick-switcher view) over the real
useRecentsProvider, inside the app's ownRedux store seeded through the real
sseSlotsaction. Nothing about theprovider, the ordering or the row rendering is stubbed; the fixtures are the slot
payload and the backend. The payload is the wire shape
slot_projection.to_dictemits — the just-prompted session carrieslast_activity_ts: ''next to a reallast_ts, every other slot carries afilled
last_activity_ts— and the three history-group fetches are refused, sothe Current group is the only group rendered. App language pinned to
enforlegibility, since every branch of
fmtRelativeTimeresolves against the applanguage rather than the browser locale.
Screenshots / video
Command Palette, Current group, at this PR's head:
Refactor the export pipeline is the just-prompted session — the one whose
transcript holds only the user's own prompt, so the wire hands it
last_activity_ts: ''. It ranks first among the sessions, above three slotslast active Monday, Friday and Aug 26, and it carries a time label (
11:55 PM)and its live
Thinking…status. Before this change that same row scored 0, sortedbelow all three, and rendered with no time at all — which is the red-before
the first and third tests in the Tests section pin (
['stale', 'live'], and atimestampofundefined).11:55 PMis the relative-time label:fmtRelativeTimeis Telegram-style,so its today branch renders the clock time, and its older branches render the
weekday (
Mon,Fri) and then the date (Aug 26) — all three forms are visiblein the frame.
Two disclosures about the hosting, since neither is the shape the template
prescribes and both are visible to a reviewer:
user-attachmentsURL.gh pr edit --attachis present(gh 2.100.0) but refuses:
attaching files requires write access to the repository, andgh api repos/kirodotdev/KiroCrew --jq .permissionsreportspush: false. GitHub gates the user-attachments upload on write access to thetarget repo, so no gh version lets a fork contributor produce one of those
URLs. A maintainer re-attaching this file, or dragging it into this box, would.
.gitignoresays review evidence isnever committed, and the diff is unchanged from the reviewed head
22ed0475c0348b1f783fc6ade2c1febc835b921c— no push accompanies this edit. Thefile lives on the fork's existing evidence branch and the link is pinned to the
immutable commit
8da0e9athat added it, not to the branch tip, so what islinked here cannot change under review.
Related Issues
None — found by comparing the palette's recency ladder against
pages/chat/sessionOrder.ts's ladder over the same wire rows, then readingslot_projection.to_dictto see which of the two matched the producer.Pattern harvest
Rule candidate:
semgrepPattern:
??used to fall back over a wire field whose producer's "absent"sentinel is the empty string — every rung below the first is then dead code.
This generalizes past this file in a checkable way, because the producer side is
where the fact lives: a Python projection that initialises a key to
""andships it unconditionally can never be read with
??on the consumer side. Thenarrow, low-false-positive shape is a chained
a ?? bwhereais a field thisrepo's own dashboard projections emit as a string default —
slot_projectionalone does it for
last_activity_ts,last_ts,last_turn_ts,served_modeland
last_message. The sibling to watch on the same wire isdashboardSlice.ts:803slot.surface ?? slot.mode ?? '', which degeneratesidentically; it has no observable today only because
to_dictsets bothsurfaceandmodefrom the sameslot.mode, so the dead rung is unreachablerather than correct.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code