Skip to content

feat(chat): open links to closed sessions through a per-key lookup - #18303

Merged
bolichen97 merged 2 commits into
mainfrom
fix/session-meta-lookup-9915
Oct 11, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
fix/session-meta-lookup-9915

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A chat link or session-key chip that names a closed session opens that session, the way its row in Older sessions does.

Session links in chat (/chat?sid=<key> and a backticked chat-N-<ts> key) only resolve against the sessions open in the sidebar. A link to a closed session whose transcript is still on disk renders as plain text, and its ?sid= click is declined. An orchestrating session that hands you links to earlier work sessions cannot take you to any of them once they are closed.

Why it matters

Looking back at earlier work is the main reason to link a session. Today every such link goes dead the moment its session is closed, so the reader has to search for the session by hand.

Not a goal

What changed (motivation → approach → change)

A link to a closed session now opens it, the same as its Older sessions row. Before, the chat only knew the open sessions, so the link went dead. Asking for the whole session list does not help: it is paged, and reading a full transcript is slow.

A link or chip names... Before After
an open session unchanged opens it unchanged opens it
a closed session still on disk plain text, click declined added a live chip; the click resumes it
a key that does not exist plain text unchanged plain text
a closed session deleted since the page loaded plain text added the click says it was deleted; nothing resumes
a closed session whose check failed plain text added the click shows "Couldn't open ..." with Ask the agent and Try again
a short name like chat-7 open sessions only unchanged open sessions only

Legend: added, changed, removed, unchanged.

The server gets one small read, GET /api/sessions/{key}/meta in dashboard/handlers/sessions.py (routed in routes/system.py). It answers one session's key and title, or 404, without reading the transcript or scanning a folder. It follows the same access rule as the other session reads: an app sees only its own sessions, and any refusal looks like a missing key. The chat page (website/src/pages/ChatPage.tsx) asks it once per key through website/src/api/client/sessions.ts, and the chips and links in website/src/components/markdown/ use the answer. The new notice strings are in every locale under website/src/i18n/, and docs/ names the new route.

Backwards compatibility

Compatible: one new read route and an opt-in context. Open-session chips and links resolve through the unchanged path, and hosts without the provider keep today's rule.

Removes nothing: the diff only adds a route, a context and a fallback after the existing open-roster lookup.

Tests

  • test/test_dashboard_session_meta.py (real auth middleware and route table): a closed session answers its row by slot key and by stem; a missing key is 404, not an empty 200; the probe reads no transcript body and does no directory scan; an app cannot probe a transcript it does not own (user-owned or another app's) and can probe its own; ownership that changes hands as the lock is taken is refused (red without the locked re-check); a lock timeout answers 503 session_busy.
  • website/src/test/MarkdownRenderer.closedSessionChip.test.tsx: a backticked closed key becomes a chip that resumes it; a ?sid= link to a closed session resumes on click; an open session still switches with no probe; an unknown key stays plain text; a short name, an offline render, and a host without the provider never probe; each key is probed once across renders (red on main, where the closed key stays inert). A chip whose click finds the session gone drops; a failed probe raises nothing until the reader clicks; a click on a chip whose probe failed shows the inline notice naming the session, and Try again opens it; a retry that fails again keeps the notice up; the notice holds two actions; one chip's failed check does not drop another chip for the same key; a ?sid= link whose probe failed shows the notice beside the link on click; a click whose own check fails shows the inline notice.
  • website/src/test/ChatPage.closedSessionProvider.test.tsx: the background lookup answers stem and title, a 404 is a quiet null, and a failed lookup raises nothing; a click whose check fails answers failed with no page banner and no resume; a click on a deleted session says it was deleted and does not resume; a click on a session that still exists calls the resume route.
  • ApiClient.refactor.surface.test.ts lists the new sessionMeta member.
  • Existing session-link suites (MarkdownRenderer.sessionChip, ChatPage.sessionChipOffline, ChatPane.sessionLinks, chatCards.sessionLink, renderUserContent.sessionLink, ChatPage.noteSessionLink) and test_app_route_trust_gate.py pass unchanged.

Determinism: test_dashboard_session_meta.py passed 20 of 20 runs at -n0, 10 of 10 at -n 4 --dist loadgroup --max-worker-restart=2 beside test_app_route_trust_gate.py and test_dashboard_sessions_clear.py, and in a shuffled order (seed 11765). The two new frontend suites passed 20 of 20 repeats and a shuffled run (--sequence.shuffle --sequence.seed=11765). test_flake_pattern_ratchet.py passes.

Manual verification

On a pod built from the head commit, with real transcripts seeded on disk, a browser script checked each step below, that nothing showed before a click, that the notice was one line, and that Try again was disabled while busy.

Screenshots / video

All taken on a pod built from the head commit: the real chat page with real transcripts on disk.

A reply names two closed sessions by key (both now chips) and links a third whose check will fail. Nothing shows before a click.

chips and link

After clicking the link whose check failed: one line at that link names the session and offers Ask the agent and Try again.

inline notice after a failed check

At a 320px-wide viewport the same notice wraps inside the message, so both actions stay visible (real MarkdownRenderer; the check is stubbed to fail).

notice at 320px

While Try again runs: the button is disabled until the check answers.

Try again busy

After clicking the chip of a session deleted since the page loaded: the page says it was deleted, and that chip turns back into plain text.

deleted session click

After clicking a working chip: the closed session is resumed and open in the chat page and the sidebar.

resumed session

Related Issues

Closes #9915

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 9, 2026 02:45
@bolichen97
bolichen97 requested a review from buluoray October 9, 2026 02:45
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 9, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) October 9, 2026 02:45
@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Check that the per-key probe cache is cleared or updated when a session closes during the page's lifetime. If not, a chip for a session closed later may stay plain text.

[DESIGN-REVIEWED] 0c8d2cd

Description read

[DESCRIPTION-READ] 84874b6bdb6e79404c87c0764021b7ea685edff81e50c46bfa62a16818e1be49

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 Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

Premise-level review of 0c8d2cd82e4fef0a09c7839ff10cd632b1ecbd58 — 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 click-time re-check, the chip shown when the probe fails, and the inline Try-again notice add a second failure UI next to the one resumeFromHistory already has.

Not justified as shipped

  • Item 4 — oversized: the Goal says links open sessions "the way its row in Older sessions does". That row just calls dispatch(resumeFromHistory(...)) (ChatSidebar.tsx:6728) and never checks again. A rejected or 404 resume is already reported through unresumableResume (store/chat/lifecycle.ts, ChatPaneNotices.tsx:209).
    Subtraction: delete the api.sessionMeta re-check and the 'gone'|'failed' outcomes in closedSessionActions.open, and let open dispatch resumeFromHistory directly.
    Clears when: the re-check is removed, or the PR shows a failure that unresumableResume does not report.
  • Item 5 — oversized: a failed probe is never cached, so a later mount retries anyway. A failed probe could stay plain text, the same as an unknown key.
    Subtraction: in useSessionChip, treat 'failed' like null and delete ClosedSessionFailure, notice state and retry.
    Clears when: that branch is removed.
  • Item 6 — duplicate of pages/chat/page/ChatPaneNotices.tsx (unresumableResume notice, which already has Ask the agent): it is a second spelling of the resume-failure notice.
    Subtraction: delete ClosedSessionNotice.tsx and the two new keys in 14 locales.
    Clears when: the component and keys are removed.

What this change ships

Inventory (8 items) — 5 justified

Intent: let a reader open a closed session from a link or key in chat. This is an ADDITION.

  1. A backticked full key for a closed session becomes a chip; clicking it resumes the session — justified
  2. A ?sid= link to a closed session resumes on click instead of being declined — justified
  3. New GET /api/sessions/{key}/meta probe that follows the app-ownership rule — justified
  4. A click checks again before resuming; a deleted session shows a page error and the chip drops — oversized
  5. A failed background probe still shows a live chip labelled with the raw key — oversized
  6. Inline "Couldn't open…" notice with Ask the agent and Try again, in 14 locales — duplicate of ChatPaneNotices.tsx unresumableResume
  7. Probe answers cached per page life — justified
  8. API docs, trust-model doc and feature-map row list the new route — justified

[FIRST-PRINCIPLES-REVIEWED] 0c8d2cd

Description read

[DESCRIPTION-READ] 33323eefd7b7a0b4639ee6e4e1146a81ebbe040650f5987ff24a341c52f54ba1

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 Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

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

UX-Verdict: CONCERNS

The failure notice names the raw key (chat-8-1791000100) beside a link that reads "the release notes draft", so the reader can't tell the notice refers to that link.

Watch

  • The notice names something the reader never saw. <ClosedSessionNotice … name={sessionLink?.key ?? ''} /> puts the slot key into "Couldn't open {{name}}." even when the link has its own text. The blind reader (shot-02): "it sits next to 'the release notes draft', but it names 'chat-8', a name I never saw". This happens on every failed titled link. It isn't fatal, because the notice sits next to the link. Fix: for an anchor, use the link's visible text as name, or use "Couldn't open this session."
  • The two failures look and behave differently. A failed check shows an inline notice with Try again. A deleted session shows a page-top banner (shot-05) that names the title "Old scratch run", while the chip the reader clicked showed chat-9-… and silently turns back into plain text. The reader: "nothing on screen says those are the same thing." This only happens on a rare path, but the reader is left confused after clicking. Fix: show "was deleted" inline at the chip, in the same ClosedSessionNotice slot, and name it the way the chip did.
  • The 320px layout breaks the sentence. In shot-03 the sentence's full stop wraps onto its own line under Try again; the reader called it "broken and messy". This shows on narrow screens only, but every time. Fix: keep the trailing punctuation with the notice using a no-wrap span, or put the notice after the sentence.

Suggestions

  • The blind reader correctly guessed that the chip opens the conversation, but rated it only a guess. After the probe answers, show the session title next to the key, or in its title tooltip, so chat-7-1791000000 says what it opens.

[UX-REVIEWED] 0c8d2cd

Description read

[DESCRIPTION-READ] bc9cca84a594f60b6131afef84baa475fa15914c642b707ac9c6b9bc3dabe92d

That sha256 names everything this verdict read: the PR description, plus the 9 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 Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 0c8d2cd82e4fef0a09c7839ff10cd632b1ecbd58 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 0c8d2cd

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

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 0c8d2cd

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

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Addressed at 7b931bb:

  • GPT F1 (ownership vs read race): fixed. App ownership is re-checked with the row under the transcript lock; a lock timeout answers 503 session_busy. A new test is red without the re-check.
  • GPT F2 (silent probe failure): fixed. A non-404 failure shows the chat page's error notice and is retried on a later render; tested at page level.
  • Opus (feature map): fixed. The endpoint moved out of the Older sessions row into its own "Closed-session links" row.
  • Opus finding (stale cache after delete): fixed. A click probes again first, so a deleted session is not resumed and its chip drops.
  • First Principles (unused fields): fixed. The body is now {key, title}.
  • UX (tooltip wording for closed targets): not taken here. It is advisory, and a new string would touch every locale; the chip opens the session as its tooltip already says.

@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 Oct 9, 2026
@bolichen97
bolichen97 force-pushed the fix/session-meta-lookup-9915 branch from 7b931bb to 96a52c1 Compare October 9, 2026 04:36
@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 Oct 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

At 96a52c1 (rebased on current main):

  • UX (notice raised with no user action): fixed. The background probe is silent. Only a click shows a notice: a failed check uses the error notice, and a deleted session says "... was deleted and cannot be opened." The chip then drops. Tested at page level.
  • GPT F1 (Members restore and crewmate status): not in this diff. As the adjudication notes, that code came from fix(members): restore the default crewmate when it was opened last #17972 and fix(crew): one status line for a crewmate's current step, still indicator #18256 on the base. The branch is now rebased so the review sees the true diff.
  • GPT finding (a link stays plain after a transient 503): kept as is. A failed background probe leaves the text plain and retries on the next mount; a click-time retry loop would add the background noise UX asked us to remove.

@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 Oct 9, 2026
@bolichen97
bolichen97 force-pushed the fix/session-meta-lookup-9915 branch from 96a52c1 to 08d7cbb Compare October 9, 2026 06:12
@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 Oct 9, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

At 08d7cbb (rebased on current main):

  • GPT F1 (errors-use-error-notice, background lookup failures disappear): addressed. A failed check is no longer silent to the reader. A probe that failed (not a 404) keeps the chip or link live, and clicking it shows an ErrorNotice inline at that spot: "Couldn't open this session." with Try again, which checks again and opens the session if it is there. The background probe itself still raises nothing, which is what the UX review asked for. Tests: MarkdownRenderer.closedSessionChip.test.tsx "a click on a chip whose probe failed shows the inline notice, and retry opens it", plus the ?sid= link and retry-fails-again cases.
  • GPT finding (inert after a transient 503): addressed by the same change. The chip stays live after a failed probe, and Try again re-asks.
  • GPT finding (docstring says no transcript read): fixed. Both docstrings now name the bounded 20-line title fallback.
  • UX (notice with no user action; raw error text): fixed. No banner and no raw text. The only failure surface is the inline notice, raised by the click, in every locale.
  • UX evidence gaps: the screenshots are now from the real chat page on a pod with seeded transcripts: the closed-session chip, the inline notice after clicking a link whose check failed, and the closed session resumed after clicking its chip.

@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 Oct 9, 2026
@bolichen97
bolichen97 force-pushed the fix/session-meta-lookup-9915 branch from 08d7cbb to 9f0fbf6 Compare October 9, 2026 06:54
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=2b0325a06fd5 Failed-probe notice and Try again are out of scope: rebutted (maintainer ruling)

Same span as at 9c9425a; the code it judges is unchanged by the rebase.
The maintainer ruled the scope on #9915 (2026-10-08): option (a), a per-key lookup that opens closed sessions, and then kept the failed-lookup notice plus Try again (recorded on this PR at 9f0fbf6).
A silent failure was a real defect in earlier rounds (errors-use-error-notice); removing the notice brings it back.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=57b18a2ddde2 The notice names the wrong thing: accepted-and-deferred

Same finding as afa01eb8b98a at 9c9425a. Real, copy only, no behaviour risk.
Deferred to #18588 task 1 (probe title, then link text, then the key), so this PR stays scoped to the lookup.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=87fe644249c4 One session goes by two names: rebutted

Same finding as 8df4591255bd at 9c9425a. The chip shows what the message author wrote, like open-session chips; the title is in its tooltip.
The banner names the session the way the sidebar does, and the chip turns back to plain text after that click, so only one name stays on screen.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=a7390873aa4a The new chip is only half-recognised as a link: rebutted

The closed-session chip reuses the open-session chip as is (InlineCode.tsx, same component and style); this PR adds no new look.
Restyling it would change every session chip, which is outside this PR's goal.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=b15ff1ee92a0 Full stop alone on its own line: accepted-and-deferred

Same finding as 98f06743fa61 at 9c9425a. Real, layout only, shows only after a failed click.
Deferred to #18588 task 2 (render the notice after the trailing punctuation), with a page-level test.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=44a2584510eb Manual probe instead of useQuery: rebutted

use-react-query is blocking: false in website/AUTOSDE.yaml. useSessionChip runs in every MarkdownRenderer host, and nothing under website/src/components/markdown/ uses useQuery, so a query hook here would need a QueryClient in hosts that do not have one.
A failed probe is not silent: the chip stays live and its click shows the notice with Try again, which asks again.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=d843d4dd913c Try again on a deleted session drops with no message: accepted-and-deferred

Real, Low: only a retry after a failed check that then finds the session deleted. Nothing is resumed and no data is touched.
Deferred to #18588 task 3 (route that retry through the same deleted banner a chip click shows), with a page-level test.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Backend Lint & Type Check is red on main too (isort on test/test_crew_log_types.py, a file this PR does not touch). The fix is #18999. This PR waits for it, then rebases.

w added 2 commits October 11, 2026 03:14
Add GET /api/sessions/{key}/meta, which answers one session's list row
from a stat and its first line, or 404 when no transcript exists. App
callers see only transcripts they own, as on every /api/sessions read.

Chat chips and ?sid= links that miss the open roster now probe that one
full key and, when it exists, resume it the way the sidebar does.

Closes #9915
… link

The meta probe re-reads app ownership with the row under the transcript
lock, answers busy on a lock timeout, and returns only key and title.
The chip's background probe stays silent. A click checks again: a
session deleted since says so and drops its chip, and a failed check,
in the click or in the earlier probe, shows an inline notice at that
chip or link with a Try again action. The feature map gets its own row
for closed-session links.
@bolichen97
bolichen97 force-pushed the fix/session-meta-lookup-9915 branch from 36e7b0d to 0c8d2cd Compare October 11, 2026 03:19
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in files this PR touches since its last head, and #18999 fixed the main-side isort red (7612507e11 -> 57df464b2b). Old head 36e7b0de07de719b3f11ff13a168ff9c0cf451a8, new head 0c8d2cd82e4fef0a09c7839ff10cd632b1ecbd58. No conflicts, still two commits; CI re-running.

@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 Oct 11, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • A session closed later re-probes: rebutted (checked)

Yes. While a key is in the open roster, useSessionChip (linkTargets.ts) deletes it from closedAnswers and closedProbes, so a close later starts a fresh probe and the chip comes back.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=86cf7e229f2f Click-time re-check duplicates unresumableResume: rebutted

resumeFromHistory on a deleted key lands in its rejected case and records reason 'failed' (store/chat/lifecycle.ts), which reads as a failed resume, not as a deleted session, and leaves the chip live for the next click.
The re-check tells the reader the session was deleted and drops the chip; it is one sessionMeta read on a click.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=3dea340e409d Failed probe could stay plain text: rebutted (maintainer ruling)

Same class as 2b0325a06fd5 at 9c9425a and 36e7b0d. The maintainer kept the failed-lookup notice plus Try again (recorded on this PR at 9f0fbf6).
A silent failure was a real defect in earlier rounds (errors-use-error-notice); treating 'failed' as null brings it back.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=43dcd34ea99f ClosedSessionNotice duplicates the unresumableResume notice: rebutted (maintainer ruling)

Same class as 2b0325a06fd5. The page-level notice fires after a resume dispatch; this one fires at the clicked link before anything is resumed, and carries Try again, which the maintainer chose to keep (9f0fbf6).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=21c4c1430ecd The notice names something the reader never saw: accepted-and-deferred

Same finding as afa01eb8b98a and 57b18a2ddde2. Real, copy only.
Deferred to #18588 task 1 (probe title, then link text, then the key).

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4edd4f6ac1c7 The two failures look and behave differently: rebutted

They are different outcomes: a failed check can be retried at the link, so it stays there; a deleted session cannot, so the page says so once and the chip goes back to the author's text.
The banner names the session as the sidebar does, the same answer as 8df4591255bd and 87fe644249c4.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=4a31662169ba The 320px layout breaks the sentence: accepted-and-deferred

Same finding as 98f06743fa61 and b15ff1ee92a0. Real, layout only, after a failed click.
Deferred to #18588 task 2 (keep the trailing punctuation with the link), with a page-level test.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=78922d9ec021 Show the session title by the chip: rebutted

The chip already carries the title: SessionChip gets sessionTitle from the probe answer, the same as open-session chips, and shows it as its tooltip.
Putting the title in the chip text would rewrite what the message author wrote.

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

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

This makes a chat link or a backticked session key that names a closed session open that session. It adds a GET /api/sessions/{key}/meta probe and a chat-page context that offers the chip only after the gateway confirms the key exists, which fixes the real cause: the frontend had no way to look up one closed key. Our earlier CHANGES_REQUESTED asked for no code change, only dispositions. The author has now posted one per UX Watch item and per First Principles item, on 9c9425a and again on the current head 0c8d2cd. The scope ruling they cite is on #9915 (option a, 2026-10-08), and the deferred UX copy and layout items sit in #18588, which has the deferred-finding label, an assignee and a Due line. I re-read the backend handler at the current head and tried to break it again. Path tricks (.., /, .threads) and the chat-N vs dashboard_chat-N alias all go through has_log/list_sessions(keys=) and the same ownership check. App callers get the uniform 404 and an audit record for a key they do not own, checked both before and under the transcript lock. The response holds only key and title, which GET /api/sessions already returns. On the frontend, a forged key gets no chip, because a 404 answer is cached as null. A click checks again before resuming, so a stale cached answer cannot resume a deleted session. All latest checks are green and GPT/Opus have no blocking findings at this head, so our request is met and I lift it. — crew-pr-reviewer (deep re-check)

@bolichen97
bolichen97 merged commit 927ee6f into main Oct 11, 2026
102 checks passed
@bolichen97
bolichen97 deleted the fix/session-meta-lookup-9915 branch October 11, 2026 06:04
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 11, 2026
chenmingwei23 pushed a commit that referenced this pull request Oct 14, 2026
* fix(chat): keep a touch text selection where the reader put it

On a phone, selecting transcript text failed three ways:
- a handle dragged under the composer dock, the chat header or the
  phone top bar (which hosts the session title) landed in their text,
  and the selection took everything in between;
- scrolling with a selection unmounted the row holding its start, and
  the browser re-rooted the start at the top of the transcript;
- a start row re-rendered while scrolled away left the start parked
  between rows, walked up to offset 0 as rows mounted above it.

(The fourth case from the original PR, a long-press opening the bubble
context menu, is already fixed on main by #18340 and is dropped here.)

Fix:
- make the header, the dock and the shell top bar inert while a
  transcript selection is held (touch only);
- add retainRange to the virtualizer: every window write keeps the
  selection's rows mounted;
- remember each endpoint as row + character offset, and put an endpoint
  that leaves its row back where it last sat. A fresh long-press, with
  no settled position yet, is never rewritten.

Replaces #18491.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>

* test(chat): give the closed-session provider mock retainRange

ChatPage now calls retainRange on selectionchange; this test landed on main (#18303) after the original PR, and its useVirtualChat mock lacked the new member.

---------

Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>
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.

Links to closed sessions should navigate to them (reusing today's resume-on-activation)

2 participants