Skip to content

fix: offer resume on a dead link to a closed session - #36263

Merged
bolichen97 merged 1 commit into
mainfrom
fix/29460-resume-closed-sid-link
Nov 13, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/29460-resume-closed-sid-link

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

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 found and 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

  • Finding or fixing what dropped the slot from open_slots.json: the gateway log that would show it rotated, and there is no reproduction.
  • Changing the handover, session_map.json, the periodic sweep, or the session_not_found recovery ladder, which is scoped to live backends on purpose.
  • Resuming on its own: the page writes the full key into ?sid= on every switch, so a reload that names it is not a request to reopen.
  • Short-name links (?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 showed Session "<key>" not found with 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:

  • a key with a transcript gets the closed notice and Resume Chat, and the click resumes that transcript and opens the session;
  • a key with no transcript keeps "not found" and offers nothing;
  • a check that fails keeps "not found" and offers nothing;
  • a session list that brings the key back while the check runs opens the session with no notice.

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.tsx ran 10 times in a row and once in a shuffled order beside ChatPage.sid.test.tsx (--sequence.shuffle --sequence.seed=29460), all green, with no act() 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):

Closed notice with Resume Chat, dark

Closed notice with Resume Chat, light

After clicking Resume Chat, the session is open:

The resumed session

A key with no transcript: unchanged "not found" (this is also what a closed session's link showed before)

Not found, no button

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

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 13, 2026 01:07
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 — 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 does not.

First-Principles-Verdict: PASS

Nothing blocks: the probe and the resume both reuse what the repo already has (api.sessionMeta, resumeFromHistory), and the defect is tracked in #29460.

Notes

  • Item 3 — second spelling of a short helper: the button runs its own copy of the probe-then-resume that closedSessionActions in website/src/pages/chat/page/sessionsDrawer.ts:263 already does, and unlike open it skips the check again at click time. Subtraction: delete the inline resumeFromHistory arrow in resumeSidClosed and call the existing closedSessionActions.open({ key, title }) (or a shared helper pulled out of it).

What this change ships

Inventory (5 items) — 4 justified

Intent: 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.

  1. After 5 s, a full-key ?sid= link that is not open now checks once whether that key has a transcript — justified
  2. When a transcript exists, the notice reads "That session was closed…" instead of "not found" — justified
  3. That notice now has a Resume Chat button, shown only while connected — duplicate of sessionsDrawer.ts closedSessionActions.open
  4. The deadline notice now appears only after the check returns, so it shows slightly later — undeclared
  5. A decision record, a feature-map row and a paragraph in the dashboard spec describe the change — justified

[FIRST-PRINCIPLES-REVIEWED] 5029bd5

Description read

[DESCRIPTION-READ] df324580e19f0f59ac6b154b5149d8fe7de57bb134331afa90997cb8f69b7841

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the fix stays in the page, reuses the existing /meta probe and resumeFromHistory path, and resumes only on a click.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • The notice says "That session was closed. Find its transcript in Older Sessions." right beside Resume Chat, which points the user two ways. The blind reader asked "whether I should go to Older Sessions or press Resume". Use a sentence that leads to the button instead, e.g. "That session was closed. Resume it to keep working."
  • The closed state uses the same red error bar as "not found" (shot-01 vs shot-04), and the blind reader "can't tell" the two apart. A closed session with a transcript isn't an error, so give this notice a neutral or info tone.
  • Shot-03 shows "Quarterly plan draft", so the blind reader "can't tell" whether Resume led there. Retake it so the session matches the one in shot-01.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 5029bd5

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 5029bd5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 5029bd5eb93c59b1590f20e4e84ef5d1bd488222 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 13, 2026 01:20
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: 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 fbc5b6b8ed · 258 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@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 Nov 13, 2026
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
@bolichen97
bolichen97 force-pushed the fix/29460-resume-closed-sid-link branch from fbc5b6b to 5029bd5 Compare November 13, 2026 04:17
@bolichen97

Copy link
Copy Markdown
Contributor Author

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 (test/test_reply_format_once.py::TestEveryMessageWhereTheBlockCannotBeTakenOut::test_the_table_names_every_selectable_harness) was main's: the test landed in #35756 without a row for every selectable harness, and #36290 fixed it on main; the new base carries that fix. Shard 7 lost its runner mid-run. The change itself is the same commit, re-applied without edits.

[operator: bolichen97]

@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 Nov 13, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 deniedSidRef identity 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 /meta probe 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 in lib/withDeadline.ts and adding a never-settling test would close this. The short-name lookup behaves the same way today.
  • useChatPageSessionController.ts:935: no test pins the connected and 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.

@bolichen97
bolichen97 merged commit 9c31bcd into main Nov 13, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/29460-resume-closed-sid-link branch November 13, 2026 06:41
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 13, 2026
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.

dashboard: a failed slot handover leaves session_map bound to an uninitialized unit, so the tab answers "Session not found" forever

2 participants