Repository navigation
fix: offer resume on a dead link to a closed session - #36263
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the probe and the resume both reuse what the repo already has ( Notes
What this change shipsInventory (5 items) — 4 justifiedIntent: a person whose tab or link names a closed session that still has a transcript can get back to it, instead of hitting a dead "not found". This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 5029bd5 Description read[DESCRIPTION-READ] df324580e19f0f59ac6b154b5149d8fe7de57bb134331afa90997cb8f69b7841 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix stays in the page, reuses the existing [DESIGN-REVIEWED] 5029bd5 Description read[DESCRIPTION-READ] da45dc2e75b1d1a54f5f98d0428527c15f53b139fa9e1936584979d724c40e23 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read Resume Chat correctly as "brings the closed conversation back so I can keep talking" and would click it, though it rated that reading only a guess. Notes
[UX-REVIEWED] 5029bd5 Description read[DESCRIPTION-READ] 0800117199025b9254383d31ea6ab471ec35c4c92ded3f5ce237f6942ddce3c0 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: |
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. At the 5 s full-key ?sid= deadline, the page now probes GET /api/sessions/{key}/meta before showing any notice. If a transcript exists, the notice reads "That session was closed" and offers a Resume Chat button that calls resumeFromHistory. A 404 or a failed probe keeps "not found". Checked: sessionMeta returns null on 404, and the backend accepts the slot-key spelling and returns the stem a resume needs. The probe result is dropped if a slots frame retired the verdict, and the recovery effect still matches on denied.error, which the new code updates. The button appears only while connected and while its own notice is showing. ErrorNotice already supports footer, both strings are existing catalog entries, and no recorded decision conflicts. Four new tests cover the closed, no-transcript, failed-probe and race paths; I couldn't run them. CI: frontend jobs and all AI review lanes passed; backend, E2E and coverage-merge jobs were still pending, and the PR changes no backend code. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
A /chat?sid=<full key> link, or a tab reloading one, whose session is no longer open answered "Session not found" after five seconds with no way back, even when the conversation's transcript was still on disk. The deadline now probes that one key first. A transcript found turns the notice into "That session was closed" with a Resume Chat button that reopens it through the history resume path; no transcript, or a failed probe, keeps "not found". It is a click, never an automatic resume, because the page writes the full key into ?sid= on every switch. Records the maintainer decision and updates the feature map. Closes #29460
fbc5b6b to
5029bd5
Compare
|
Rebased: main moved in docs/decisions/README.md, docs/feature-map/README.md and docs/system-specs/modules/learn-cron-dashboard.md since this head's CI ran (72fc530 -> 27e9359); CI re-running. The Backend Tests shard 8 red on Linux and Windows ( [operator: bolichen97] |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. On this head the review checked these things:
- The new deadline probe sends the URL slot key to the existing
GET /api/sessions/{key}/meta. That route also matches the slot's transcript key, so Resume gets the transcript stem (test 1 pins this). - A slots frame that arrives while the probe is pending still clears the notice. The
deniedSidRefidentity check handles this, and test 4 pins it. - Tests 1 and 4 fail with the controller change reverted. The "not found" paths are unchanged.
- No new route, auth or trust-boundary change.
- The controller stays under the line cap.
Done well: the closed sentence is written into the same denied object, so the existing recovery effect still clears the right notice. The fix needs no new backend surface.
Optional:
useChatPageSessionController.ts:907: the notice now waits on a/metaprobe that has no deadline. A request that never returns shows no notice, where the old code showed "not found" at 5 s. Wrapping the probe inlib/withDeadline.tsand adding a never-settling test would close this. The short-name lookup behaves the same way today.useChatPageSessionController.ts:935: no test pins theconnectedand same-notice gates on the Resume button. One case could dispatch a disconnect after the button shows and assert the button is gone.- The closing note could say the session_map and open_slots split is left as is by decision. That way a later report of the same backend state is not read as a regression of this PR.
Problem / Motivation
Goal: A chat link or a reloaded tab that names a session which is no longer open, but whose transcript is still on disk, offers to resume it instead of a dead
Session "<key>" not found.A dashboard tab whose session had dropped out of the open-tab list answered
Session "chat-111-…" not foundand stayed that way. The conversation was still on disk, but the notice had nothing to click, and the only remedy the reporter found, closing the tab, hid the last way back to it.Why it matters
Anyone whose session leaves the open list while a tab or bookmark still names it (a close in another tab, an open-tab entry lost after a failed respawn) lands on a page that looks broken and offers no way back to work that still exists. Nothing on screen points at Older Sessions, so most people stop there.
Not a goal
open_slots.json: the gateway log that would show it rotated, and there is no reproduction.session_map.json, the periodic sweep, or thesession_not_foundrecovery ladder, which is scoped to live backends on purpose.?sid=on every switch, so a reload that names it is not a request to reopen.?sid=chat-7), which already look up closed sessions.What changed (motivation → approach → change)
A
/chat?sid=<full key>link, or a tab reloading one, whose session is not in the open list after 5 seconds showedSession "<key>" not foundwith nothing to click. The page never asked whether that key still had a transcript, although the closed-session chips in chat messages already ask exactly that, one key at a time (GET /api/sessions/{key}/meta).At that deadline the page now asks the same question before it shows anything, so the notice never changes its mind. A transcript found: the notice says "That session was closed. Find its transcript in Older Sessions." and carries a Resume Chat button, which reopens it the way an Older Sessions row does. No transcript, or a check that fails: "not found", as before. A session list that brings the key back while the check runs still opens the session, with no notice. The button shows only while connected and while that notice is on screen, and both strings are existing catalog entries.
The decision record, the feature map's link row and the dashboard spec's deep-link paragraph describe it.
Backwards compatibility
Compatible: a key with no transcript, or a failed check, shows the same "not found" notice as before, and no request, field or route changes shape.
Removes nothing: the notice gains a probe and a button; every existing path out of it stays.
Tests
website/src/test/ChatPage.sidClosed.test.tsx, a full-key?sid=link to a session that is not open:With the controller change reverted, the first and fourth cases fail (the notice reads "not found" with no button, and no check runs for a session list to overtake); the second and third pass on both, since they pin the "not found" paths that must not change.
Proof: not provable -- frontend test (prove.py runs Python only)
Determinism:
ChatPage.sidClosed.test.tsxran 10 times in a row and once in a shuffled order besideChatPage.sid.test.tsx(--sequence.shuffle --sequence.seed=29460), all green, with noact()warning.Manual verification
Scripted Playwright against the SPA built from this head (
website/dist), every/api/**call answered from fixtures, opening/chat?sid=chat-111-1793645648: with no transcript the notice says "not found" and has no button; with a transcript it is the closed notice with Resume Chat, in dark and light; clicking Resume Chat posts the resume and opens the transcript. Not run against a live gateway holding an orphaned slot: the reporter's trigger has no reproduction.Screenshots / video
A full-key link to a closed session that still has a transcript, after the change (dark, then light):
After clicking Resume Chat, the session is open:
A key with no transcript: unchanged "not found" (this is also what a closed session's link showed before)
Related Issues
Closes #29460
Sibling sweep
Swept: git grep -n "session_not_found" -- website/src/pages
Sibling: website/src/pages/chat/useChatPageSessionController.ts:1032 -- not affected -- the short-name lookup already searches closed transcripts and opens one; it says "not found" only when none exists
Pattern harvest
Not generalizable: the full-key deadline was the one dead end left for a closed session's link; the chips, short names and Back/Forward already know about closed transcripts.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)