Skip to content

fix: refetch slots when a sidebar rename is refused (#10151) - #10172

Merged
bolichen97 merged 2 commits into
mainfrom
fix/sidebar-rename-recovery-10151
Sep 18, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
fix/sidebar-rename-recovery-10151

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Renaming a session inline in the sidebar dispatches the new title
optimistically, then calls the rename endpoint. When the server refuses the
rename, the recovery path called
queryClient.invalidateQueries({ queryKey: ['chat-slots'] }) -- but no React
Query is registered on a plain ['chat-slots'] key (the only matching keys
are one-shot fetchQuery calls with gcTime: 0 in useSessionActions),
so the invalidate was a no-op. The refused optimistic title stayed in the
sidebar until an unrelated slot refetch or a page reload, and nothing told
the user the rename had failed.

Why it matters

The sidebar silently lies about the session's real title after any refused
rename: the user believes the rename succeeded, and every surface that shows
the server truth (other tabs, search, a later reload) disagrees with what
they see. Because the recovery was a no-op, the stale title could persist
for an entire session.

What changed (motivation -> approach -> change)

Symptom: a refused rename leaves the optimistic title on screen.
Root cause: the recovery invalidated a React Query cache key that no query
is registered on, while slot titles actually live in the Redux dashboard
slice (written by sseSlots / fetchSlots.fulfilled).

Change: the .catch in onRenameCommit recovers ONLY the refused slot. It
fetches the server slot list, takes just this slot's server title, and
writes it back through sseSlotTitle under a compare-and-set gated on BOTH
the store title and a per-slot rename generation: it reverts only while the
store title is still the refused optimistic value AND this attempt is still
the latest generation. The generation guard closes the
refuse-X -> rename-back-to-X-succeeds race, where the title-only compare
would falsely match (the store title equals the refused value in both
attempts) and a stale earlier recovery would restore the old server title
over the newer accepted rename. A prior revision dispatched fetchSlots(),
which runs applySlots -- a whole-list replace that would overwrite a
fresher sseSlotTitle frame for any OTHER slot that arrived during the
recovery round-trip. Narrowing to the one slot removes that clobber window
entirely. This mirrors the already-shipped ChatPage inline-rename recovery,
which uses the same compare-and-set and generation counter.

The failure also renders: a renameError state feeds an ErrorNotice in
the sidebar-root notice cluster, per the errors-use-error-notice rule.
Message keys reuse the existing pages.chatPage rename-failure strings, so
no new catalog entries.

Two same-file dead-key ['chat-slots'] no-ops the fix's own thesis exposes --
bulkModelMutation (bulk model switch) and dropSlotMutation (drop a slot
onto a tag lane) -- are REMOVED here, not converted to an eager refresh. Both
invalidated the same unregistered ['chat-slots'] key, so the call did
nothing and the switched models / moved row already refreshed on the next
authoritative sseSlots push. An eager client-side patch that reflected them
sooner would need a per-field reconciliation contract to avoid overwriting a
reordered authoritative frame -- the whole-list applySlots reducer-contract
work tracked in #11149, which affects 8 of 11 fetchSlots callers repo-wide,
not just these two sites. Carrying that contract into a rename-recovery fix is
out of scope, so the no-op call is deleted and the pre-existing
next-sseSlots-push behaviour is kept unchanged. The eager-refresh + per-field
reconciliation for these sites is deferred to #11149.

Transport-failure behaviour (deliberate)

If the gateway is down, the recovery read (api.chatSlots()) itself fails.
The .catch then leaves the optimistic title in place rather than guessing a
revert value -- there is no authoritative truth to revert to while offline,
and the failure is already surfaced through ErrorNotice. The next
authoritative frame (sseSlots / sseSlotTitle) reconciles the title when
the connection returns. This is a conscious choice, not a gap: inventing a
revert target with no server contact would be its own lie.

Tests

website/src/test/ChatSidebar.renameFailureRecovery.test.tsx drives the
real inline-rename UI (double-click, textarea, blur commit):

  • refused rename: the optimistic title lands first, the recovery read fires,
    the store title snaps back to the server value, and the ErrorNotice renders
    (the revert is not silent).
  • accepted rename: the title is kept and no recovery read fires.
  • WS-clobber protection: a concurrent sseSlotTitle on a DIFFERENT slot,
    arriving while the recovery read is in flight, survives recovery. This
    reddens under the old whole-list fetchSlots() recovery (mutation-verified).
  • compare-and-set: a newer authoritative frame on the RENAMED slot during the
    recovery read is not reverted to the stale server value. Also reddens under
    the old recovery.
  • generation guard: a first rename to X is refused with its recovery read
    parked, then a second rename to the same string X succeeds; the stale first
    recovery must not stomp the accepted rename. Reddens when the generation
    clause is removed from the compare-and-set (mutation-verified).
  • both-reject / transport-down: when renameSlot and the recovery chatSlots
    read both reject, the optimistic title deliberately stays and the ErrorNotice
    renders -- there is no server truth to revert to offline (bolichen97 review
    item).

Manual verification

website/scripts/capture-rename-failure-recovery.mjs runs the built SPA
against fixture endpoints, answers the title PATCH with a delayed 500, and
walks the full flow; its console assertion checks the recovered title is
visible and the refused draft is gone. This script is the reproducible
evidence harness; it is not committed evidence output.

Screenshots / video

The three evidence PNGs previously committed under temp-screenshots/ have
been removed: per prepare-pr/SKILL.md, temp-screenshots/ is never a
commit path and evidence must be a GitHub attachment. The frames are
regenerable by the capture script above and are being attached to the PR
rather than committed.

Related Issues

Fixes #10151

Pattern harvest

Rule candidate: a cache-invalidation recovery must target the store the data
actually lives in. Here the recovery invalidated a React Query key with no
registered query, so it was a silent no-op while the titles lived in Redux.
The same dead key had two more no-op uses in the same file; when a fix exposes
a dead key, every use of that key in the file it edits should be checked. But
the corollary that surfaced in review is a scope one: converting those extra
uses to an eager client refresh dragged in a per-field reconciliation contract
(a reordered response can overwrite a newer authoritative frame) far larger
than the recovery fix. The disciplined move was to delete the no-ops -- which
changes no behaviour, since they never did anything -- and defer the eager
refresh to the reducer-contract issue (#11149) that owns it, rather than grow
the fix round after round chasing the contract.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|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

Sidebar inline rename: editing the title in the textarea

Optimistic title shown immediately after commit, before the server answers

Refused rename recovered: title snapped back to the server value with the ErrorNotice

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of ebe1a609f9b3210227c532fc072a34b759de9be0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Two divergent copies of a subtle rename-recovery CAS now exist: sidebar and ChatPage handle the failed recovery read oppositely while claiming to mirror.

Watch

  • The PR says the fix "mirrors the proven ChatPage inline-rename recovery," but SessionTitleControl.tsx:228 reverts to rec.baseline when the recovery read fails, while this copy deliberately keeps the optimistic title ("Leave the optimistic title in place rather than guessing"). Same refused rename, transport down → opposite outcomes depending on which surface the user renamed from, and the sidebar copy carries a dead baseline: '' field as residue of the incomplete mirror. Duplicating generation/CAS concurrency machinery also means a race fix in one copy won't reach the other.
    Clears when: the two surfaces share one recovery helper, or the PR states which transport-failure behavior is canonical and the other surface (or its doc) is aligned in a named follow-up.

Suggestions

[DESIGN-REVIEWED] ebe1a60

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 5.6 flagged blocking issues on ebe1a609f9b3210227c532fc072a34b759de9be0; Opus 4.8 adjudication downgraded every one of them to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions.

This comment is updated in place on each push.

Review details

BLOCKING -- website/src/pages/ChatSidebar.tsx:4548 -- 200-level drop refusals are silently ignored

onSuccess: () => {},
stale status lane -> drop returns {ok:false, reason} with HTTP 200 -> no boardError notice appears
Anchor: errors-use-error-notice
Fix: inspect the response and set boardError from reason when ok is false.
[BLOCK-MERGE-DOWNGRADED] ebe1a60
[GPT-REVIEWED] ebe1a60

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

F1 — dropSlotMutation.onSuccess is a no-op (ChatSidebar.tsx:4548); dropSlotToColumn parses the 200 body via .then(j) (client.ts:3801) so an {ok:false,reason} refusal is not surfaced.

  • Harm rung: LOW. A refused slot drop returns 200 {ok:false}; no boardError banner appears. But the row simply does not move (comment 4540–4541: it only reflects on the next authoritative sseSlots push, which a refusal won't produce), so the user gets a visible "nothing happened" signal and can retry; no data loss, no corruption. Genuine HTTP errors still route through ErrorNotice via onError (4549).

  • The anchored rule errors-use-error-notice (AUTOSDE blocking: true) governs the rendering mechanism of an error shown to the user (no hand-written div / bare role="alert" / error in <p>) — none of which occurs here; the onError path already uses ErrorNotice. It does not mandate surfacing every soft 200-refusal, so the finding is not a true instance of that rule.

  • Remedy cost: the author documents (4544–4547) that surfacing this refusal correctly is entangled with the eager per-field reconciliation contract of applySlots is a whole-list positional replace: 8 of 11 fetchSlots() callers can clobber a concurrent WS update #11149; a bare banner without the reducer work leaves the row visibly unmoved beside an error, and doing it right belongs to that separate effort. Against a LOW, visible, self-correcting harm, blocking is disproportionate.

    [ADJUDICATION] ebe1a60 total=1 uphold=0 downgrade=1
    DOWNGRADE F1 website/src/pages/ChatSidebar.tsx:4548 reason=disproportionate-remedy
    [GPT-ADJUDICATED] ebe1a60

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ebe1a609f9b3210227c532fc072a34b759de9be0: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of ebe1a609f9b3210227c532fc072a34b759de9be0 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

Refused-rename ErrorNotice renders one word per line in the sidebar — shot-03 shows a barely readable stack of "Couldn't/rename/the/session/rename/refused".

Watch

  • The notice's flex row gives AskAgentButton its intrinsic width inside the ~240px sidebar, squeezing the text column to one word per line (shot-03; blind reader: "the one-word-per-line stacking makes it hard to read"). Rare event (refused rename) but every occurrence renders this way, and this is the moment the user most needs to read it. Fix: let the text span the full notice width and wrap "Ask the agent" onto its own row (or drop the title and keep a single short line, matching the sibling new-chat-error which passes no title).
  • Title and raw server text run together with no separator — "Couldn't rename the session rename refused" reads as "two messages jammed together" (blind reader's words). Same root layout cause; fixing the wrap plus visually separating the message resolves both.

Suggestions

  • Pass messageClassName="font-mono" on the new rename-error ErrorNotice — the component documents exactly this for verbatim server output, so the raw error reads as a separate clause from the plain-language title.

[UX-REVIEWED] ebe1a60

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of ebe1a609f9b3210227c532fc072a34b759de9be0 — 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/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The recovery re-implements SessionTitleControl's renameRecovery as a second, already-diverging spelling, and the dead-key cleanup leaves 2 counted siblings in other files.

Not justified as shipped

  • Item 1 — duplicate of website/src/pages/chat/SessionTitleControl.tsx: the description says it "mirrors the proven ChatPage inline-rename recovery", i.e. a second spelling (grep renameRecovery: 2 implementations), and they already diverge — offline, the twin's catch reverts to rec.baseline (SessionTitleControl.tsx:228) while this copy keeps the optimistic title, which the description calls "its own lie".
    Subtraction: replace the inline copy at ChatSidebar.tsx:3361–3448 with the one mechanism SessionTitleControl already ships, so one spelling serves both rename surfaces.
    Clears when: the sidebar consumes a single shared implementation, or the twin's offline baseline-revert is shown wrong so the copies are genuinely different.
  • Items 4–5 — rides along, point patch: deletes 2 of 4 dead-key invalidateQueries(['chat-slots']) no-ops; grep 'chat-slots' counts 2 unfixed siblings, website/src/components/TagManagerList.tsx:62 and website/src/hooks/useSessionActions.ts:196 — the description's own rule ("every use of that key… should be checked") was scoped to one file.
    Subtraction: delete the two sibling no-op invalidations as well.
    Clears when: those two lines are deleted, or a registered ['chat-slots'] query is named that makes them live.

What this change ships

Inventory (7 items) — 4 justified

Intent: stop a server-refused sidebar rename from leaving the wrong title on screen forever (#10151) — a FIX.

  1. A refused sidebar rename now snaps back to the server title — duplicate of website/src/pages/chat/SessionTitleControl.tsx (second spelling of its renameRecovery)
  2. The rename failure now shows a dismissable error notice in the sidebar — justified
  3. When the gateway is also down, the optimistic title deliberately stays — justified
  4. Bulk model switch no longer issues its dead cache invalidation (no visible change) — rides along; point patch, 2 siblings unfixed
  5. Drop-slot-to-lane no longer issues its dead cache invalidation (no visible change) — rides along; same point patch
  6. A new committed screenshot-capture script for the rename flow — rides along
  7. Regression tests pinning revert, non-clobber, generation guard, offline keep — justified

[FIRST-PRINCIPLES-REVIEWED] ebe1a60

@github-actions

github-actions Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed ebe1a609f9b3210227c532fc072a34b759de9be0 — this comment is updated in place on each push.

Review details

No findings that block.

FINDING — website/src/pages/ChatSidebar.tsx:3439 — renameError is set on a refused rename but the success branch (() => settle()) and onRenameCommit entry never clear it, and the only reset is the manual onDismiss at line 8134, so a stale "Couldn't rename the session" notice persists after a subsequent rename actually succeeds → Fix: call setRenameError('') at the start of onRenameCommit (or in the .then success callback) so a successful rename clears the prior failure notice.

[OPUS-REVIEWED] ebe1a60

Verdict parsed from the review's SHA-scoped output markers for commit ebe1a609f9b3210227c532fc072a34b759de9be0.

False positive or not applicable? A repository writer can comment:
/ai-review override fable ebe1a609f9b3210227c532fc072a34b759de9be0: <one-sentence reason>

@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 Sep 11, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: chenmingwei23#de330d0c]

Answering the two advisory CONCERNS on head de9f277. Both blocking lanes are green, so per review discipline these are dispositioned in-thread rather than with a new head.

First Principles -- both watch items now point at checkable follow-ups:

UX Review -- both watch items are real and acknowledged:

  • The run-on "title + raw server text" and the one-word-per-line wrap in the ~250px sidebar are layout traits of the shared block ErrorNotice in a narrow container; the sidebar-root cluster's existing notices (folder-action, new-chat, board) share them. A separator/messageClassName treatment and narrow-container wrapping for the askAgent row belong to that shared component, so fixing them here would fork one call site's rendering away from its siblings. Tracked as UX polish on the shared component rather than patched per-site; if maintainers want it in this PR, say so and it ships as one head.

No code change: the head is converged (all blocking lanes green, PR Readiness success) and both concerns are advisory with named exits.

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

Maintainer review (agent-assisted), pinned to de9f277. The no-op cache-invalidation diagnosis is correct, but the replacement recovery still depends on the same connection that just failed. When renameSlot rejects because the gateway is unreachable or authentication expired, fetchSlots rejects too; there is no fetchSlots.rejected title rollback, so the refused optimistic title remains beside a notice saying the rename failed. The two added tests pass locally but only cover a successful recovery GET, not this case. Please implement a local, field-scoped rollback that preserves newer authoritative changes and add a test where both renameSlot and chatSlots reject. A global refetch alone cannot provide that guarantee. Coordination note: #9485 replaces these same lines with a shared rename lifecycle used by sidebar and header; #10237 covers the header separately. Converge on one recovery contract rather than landing divergent mechanisms. Do not use another authoritative-title event to mark a client-only rollback as server confirmation.

@iamwhatever

Copy link
Copy Markdown
Contributor

Not approving for now: there is an outstanding changes-requested review on this PR; we'll take another look once it is addressed and cleared.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 14, 2026
buluoray
buluoray previously approved these changes Sep 15, 2026

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

Approved on the code. The root cause checks out: the baseline .catch() at ChatSidebar.tsx:3350 invalidated a plain ["chat-slots"] key that no React Query is registered on, so the recovery was a genuine no-op rather than merely slow. The replacement restores truth unconditionally, since applySlots keeps the incoming row whenever jsonEqual fails, and the optimistic title differs from the server one by construction. No refetch loop: onRenameCommit fires only on a user commit and fetchSlots never re-enters it. The new failure surface goes through ErrorNotice rather than a hand-rolled red div, so the blocking AUTOSDE rule is satisfied, and both new i18n keys resolve for every shipped language via the manual catalog merge.

Please note before merging:

  • The PR is mergeable=CONFLICTING, so no fresh pull_request-event run exists at this head and the green you see is stale. Rebase, then re-read CI.

Non-blocking:

  • A refused rename and a network error take the same .catch path. That is defensible because the surfaced text is the real error rather than a hardcoded refusal, but the user cannot tell a server refusal from a dropped connection, and the recovery action differs between the two.
  • Issue #10151 lists three acceptance items and this resolves the core one. The draft-cap stopgap on the rename field and the pending-state cue during the re-read window are still open, so worth saying which of them this closes.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 15, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Heads up from a supervisor session that was NOT scoped to this PR: I merged current main into this branch to clear a merge conflict, then pushed as a fast-forward. That was out of my scope -- I was supervising a different workstream and swept every conflicted PR instead of only mine. No revert, because another push would just re-run CI and bring the conflict back.

What was and was not done:

  • git merge origin/main only. No rebase, no force-push, no change to this PR's own commits.
  • Conflicts resolved by keeping both sides where both were additive, and by taking main's side only where main had replaced the code the branch was editing. Each resolution is described in the merge commit's session record; ask and I will paste the detail here.
  • Relevant tests for the conflicted files were run and passed. The full suite was not run.
  • Nothing else touched: no review feedback addressed, no description edited, no approval, no merge, no /ai-review override.

One consequence you should know: this repository has dismiss_stale_reviews enabled, so the push dismissed the approvals that were on this PR. That happens on any new commit, force-push or not, so a conflict resolution costs them regardless of who does it -- but it was my push that spent them here.

If you would rather this branch had been left alone, say so and I will stay off it.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@chenmingwei23
chenmingwei23 force-pushed the fix/sidebar-rename-recovery-10151 branch from 833d527 to 52d5c73 Compare September 16, 2026 16:25
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

GPT 5.6 -- fenced findings on the slot-refresh guard: stopping the patch loop, need a ruling

Head 52d5c735f4429132be839b26a702db270f12b0df. Both remaining GPT blocking findings are security-class (fenced), and Opus adjudicated both as acceptable transient residual (total=0 uphold=0 downgrade=0, both FLAGged as likely edge cases). I am stopping the fix loop here rather than pushing another round, because each round's fix has seeded the next round's finding in the same span, and the current ask is a redesign that is out of this PR's scope.

Convergence history (bulk-model / drop-to-column refresh sites)

Round State GPT finding My fix
A dead-key invalidateQueries no-op silent no-op / stale until 5s push converted to dispatch(fetchSlots()) (whole-list)
B whole-list fetchSlots() applySlots clobbers a newer SSE frame for an unrelated slot per-slot updateSlot patch from each mutation's authoritative response
C per-slot patch, no revision guard reordered older response overwrites newer same-field SSE gated each patch on slotsGeneration captured at request time
D (now) slotsGeneration guard generation bumps on a stale reconnect snapshot too; recovery gen is title-only "use per-slot per-field generations bumped by every model/tag/title writer"

Why I am not patching round D

The round-D remedy is a per-field generation-counter subsystem: every writer of slot.model, slot.tags, and slot.title would have to bump a per-slot, per-field counter, and every optimistic patch would gate on it. That is a change to the dashboard slice's reducer contract touching all slot writers -- the same whole-list applySlots reducer-contract issue already filed as #11149, which affects 8 of 11 fetchSlots callers repo-wide, not just this PR's two sites. It is disproportionate to what both findings actually cost:

  • F1 (:3951, :4585) -- the skipped patch leaves a transient stale label (model / lane) on the client that just made the change. The mutation already committed server-side; the endpoint broadcasts a slots update and the ~5s periodic sseSlots push reconciles the display. No persisted corruption. Trigger needs a reconnect snapshot in flight inside the request->success window.
  • F2 (:3435) -- the rename recovery restores an old title client-side only (it never re-calls renameSlot, so nothing stale is written to the server), on the client that already sees an ErrorNotice, and self-corrects on the next authoritative frame. Trigger needs a second client committing the same target value inside the failed-rename recovery window. This is the generation+CAS guard ported verbatim from the shipped ChatPage.tsx recovery.

Both are fenced/security-class, so a rebuttal comment cannot clear them and I will not override a fenced finding. Both are Opus-adjudicated acceptable residual.

Decision needed (maintainer)

  1. Override both as acceptable transient client-only staleness (Opus pre-drafted the rationales; the fence requires a writer to post /ai-review override gpt <sha>: <reason>), and let the per-field-generation work land as its own change under applySlots is a whole-list positional replace: 8 of 11 fetchSlots() callers can clobber a concurrent WS update #11149; or
  2. Descope the two dead-key conversions from this PR -- revert bulkModelMutation / dropSlotMutation to their original invalidateQueries no-op (their pre-existing behavior, refresh on the next 5s push) so this PR carries only the rename-recovery fix (Sidebar rename failure recovery is a no-op (invalidateQueries on unregistered 'chat-slots' key) #10151), and track the eager-refresh + per-field-generation design in applySlots is a whole-list positional replace: 8 of 11 fetchSlots() callers can clobber a concurrent WS update #11149; or
  3. Redesign now -- build the per-field generation counters in this PR (larger diff, reducer-contract change across all slot writers).

My recommendation is (2): the rename-recovery fix is the issue this PR exists for and is clean; the two dead-key conversions are a "while I'm here" addition whose correct form is the #11149 reducer-contract change, and descoping removes the fenced findings structurally without an override. I will not act on any of these without your ruling.

@chenmingwei23
chenmingwei23 force-pushed the fix/sidebar-rename-recovery-10151 branch from 52d5c73 to af182af Compare September 16, 2026 17:11
@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 Sep 16, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Descoped the two dead-key sites -- head af182af15f

Following the convergence write-up above, I took option 2 (descope) rather than wait on a ruling, since it is a decision within scope and needs no fenced override.

The two ['chat-slots'] dead-key no-ops (bulkModelMutation, dropSlotMutation) are now removed, not converted to an eager client refresh. Deleting a call that never did anything changes no behaviour: the switched models / moved row still refresh on the next authoritative sseSlots push, exactly as before this PR. This removes the basis of both fenced GPT findings structurally -- there is no client-side optimistic patch left to reorder against a newer frame, so nothing to guard and nothing to override.

The eager refresh + the per-field reconciliation contract it needs (the whole-list applySlots issue, 8 of 11 fetchSlots callers) stay tracked in #11149, which owns that work.

This PR is now just the #10151 rename-recovery fix (generation + title CAS, ErrorNotice), plus the board-ErrorNotice lane-level mount so board-write onError surfaces in flat/tree views. Local: tsc + eslint clean, 106 frontend tests pass across the three affected files (the rename-recovery generation-guard and both-reject tests included).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 16, 2026
Gate the refused-rename recovery on a per-slot generation + title CAS so a refuse-X -> rename-back-to-X race cannot restore the stale title, and surface the refused rename through an ErrorNotice. The two same-file dead-key ['chat-slots'] no-ops (bulk-model switch, drop-to-column) are removed rather than converted to an eager client refresh: an eager per-slot patch needs the whole-list applySlots per-field reconciliation contract tracked in #11149, out of scope for this recovery fix; the pre-existing next-sseSlots-push behaviour is unchanged. Hoist the board ErrorNotice to lane level so board-write onError surfaces in flat/tree views too.
@chenmingwei23
chenmingwei23 force-pushed the fix/sidebar-rename-recovery-10151 branch from af182af to ebe1a60 Compare September 16, 2026 18:52
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 16, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

The reviewed commit de9f277 has diverged from the current head ebe1a60 (compare returns diverged, ahead 312 behind 1), so the pinned changes-requested judges code no longer on this branch line. Requesting a fresh review on the current head. This does not remove the recorded objection; it flags that the reviewed code no longer exists at this head.

@bolichen97
bolichen97 merged commit 61bee88 into main Sep 18, 2026
84 of 90 checks passed
@bolichen97
bolichen97 deleted the fix/sidebar-rename-recovery-10151 branch September 18, 2026 00:29
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 18, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
kirodotdev#10172)

* fix: narrow refused-rename recovery to the failed slot (kirodotdev#10151)

Address the two blocking reviews on the sidebar rename-recovery fix.

Recovery now reconciles ONLY the refused slot instead of dispatching
fetchSlots(). fetchSlots() runs applySlots, a whole-list replace that
could overwrite a fresher sseSlotTitle frame for any OTHER slot that
arrived while the recovery read was in flight (the data-loss anchor GPT
flagged). The .catch now fetches the server slot list, takes just this
slot's server title, and writes it back via sseSlotTitle under a
compare-and-set: it reverts only while the store title is still the
refused optimistic value, so a newer authoritative frame is not stomped.
Mirrors the proven ChatPage inline-rename recovery.

Convert two same-file dead-key no-ops that the PR's own thesis exposes:
bulkModelMutation and dropSlotMutation both invalidated ['chat-slots'],
a key with no registered query, so their intended refresh (switched
models, moved-lane tags) only landed on the next sseSlots push. Both now
dispatch(fetchSlots()). The three other ['chat-slots'] call sites outside
this file are left deferred per the reviewer's split.

Remove the three committed evidence PNGs under temp-screenshots/; per
prepare-pr/SKILL.md that is never a commit path and evidence must be a
GitHub attachment. The frames are re-attached to the PR.

Tests: add a WS-clobber-protection test (a concurrent sseSlotTitle on
another slot survives recovery) and a compare-and-set test (a newer frame
on the renamed slot is not reverted). Both redden under the old
whole-list fetchSlots() recovery, verified by mutation.

* fix(sidebar): guard refused-rename recovery by generation (kirodotdev#10151)

Gate the refused-rename recovery on a per-slot generation + title CAS so a refuse-X -> rename-back-to-X race cannot restore the stale title, and surface the refused rename through an ErrorNotice. The two same-file dead-key ['chat-slots'] no-ops (bulk-model switch, drop-to-column) are removed rather than converted to an eager client refresh: an eager per-slot patch needs the whole-list applySlots per-field reconciliation contract tracked in kirodotdev#11149, out of scope for this recovery fix; the pre-existing next-sseSlots-push behaviour is unchanged. Hoist the board ErrorNotice to lane level so board-write onError surfaces in flat/tree views too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sidebar rename failure recovery is a no-op (invalidateQueries on unregistered 'chat-slots' key)

4 participants