Skip to content

feat: open a session from a bot's sessions tab recap - #37298

Closed
RohanK6 wants to merge 1 commit into
mainfrom
crew/conductor/open-session-36175
Closed

RohanK6 wants to merge 1 commit into
mainfrom
crew/conductor/open-session-36175

Conversation

@RohanK6

@RohanK6 RohanK6 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a person open any session on a Bot’s Sessions tab in the chat view, straight from its recap, reopening a closed one first.

A Bot’s Sessions tab lists the sessions it dispatched, and a click expands a row into a recap. Nothing on the row or in the recap opens the session. A Bot’s sessions leave the person’s own session lists for this tab, so it is the only list of them, and the only way to read what a worker did, or to type to it, was History or search. The maintainer recorded the change in docs/decisions/2026-11-12-a-bots-sessions-tab-opens-a-session-and-shows-the-task-it-was-last-given.md (#36187).

Why it matters

Every Bot owner who wants to check on or steer a worker hits this. The tab shows which session matters, then gives no way in.

Not a goal

  • The recap that reads “No report yet” for a worker that has replied (A Bot's Sessions tab says "No report yet" for workers that have reported #36177): the same decision covers it, but it needs a backend read of the Bot’s last message and is a separate change.
  • Making the whole row open the session: the decision keeps the click as an in-place recap.
  • Rewording “open that session from the sidebar to answer it” on the approvals and questions lines.

What changed (motivation → approach → change)

  • Open session (MateSessionsList.tsx): the opened recap gets one button under it. It asks the page’s unsaved-edits question first, then opens /chat?sid=<key>, the same navigation a session link in the Bot’s chat uses (openSessionGuarded).
  • Reopen session: for a closed session, after the same question it calls reopenCrewSession, the call the chat page’s Workers list makes, and opens the session only when that reopen took the view. A failed reopen keeps the person on the page and says so under the button. keepPanel is false, so the session lands as a live one does, with no Workers panel held open beside it.
  • Closed state: a closed session’s recap says, above the button, that the session is closed and that reopening brings back its saved conversation and runs nothing again, since the row’s group does not say "closed".
  • Another crew: a row with remote_crew names no local session, so it shows one line naming that crew and no button.
  • Accessibility: the button’s name carries the session title (“Open session: <title>”). While a reopen runs it stays focusable (aria-disabled), ignores a second press and its name says “Reopening <title>…”.
  • MembersPageSidePanel.tsx exposes the Schedules guard on its own (confirmSessionLeave) and the raw chat-page open (openSessionOnChatPage), so the question can come before the reopen; MembersPageProfile.tsx passes both to the list.
  • Eight new strings in all 12 languages; crew-mode.md and the feature map describe the button.

Backwards compatibility

Compatible: the tab gains a button; the row click, the recap and every other way off the page behave as before.

Removes nothing: the change only adds a control under the recap.

Tests

  • MateSessionsList.test.tsx: a live session opens after the question; a refused question opens nothing; a closed session’s recap says it is closed, then it is reopened with its key and title, the button holds and names the reopen, then the reopened key opens; a failed reopen shows the line and stays; a reopen that did not take the view moves nobody; a reopen that lands after the tab closed moves nobody; StrictMode still opens; a remote session has a line and no button; the row click alone never asks or opens.
  • MembersPageProfile.drivingTitle.test.tsx: the Profile card wires the list to the side panel’s guard and chat-page open.
  • Proof: not provable -- frontend test (prove.py runs Python only). The new cases fail with MateSessionsList.tsx reverted to main (7 failed, 25 passed before the review fixes added two more).

Manual verification

Rendered the real MateSessionsList in headless Chromium from a static harness build (en and de), with three sessions: a live one, a closed one whose reopen fails, and one on another crew.

Screenshots / video

Before (main): the opened recap has no way into the session.

before-live-en

before-live-de

After: a live session’s recap with Open session.

after-live-en

after-live-de

After: a closed session, with the closed line, after a failed reopen.

after-closed-en

after-closed-de

After: a session on another crew.

after-remote-en

after-remote-de

Related Issues

Fixes #36175

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

Contribution License Agreement

Contributions are accepted under the project’s Apache-2.0 license.

@RohanK6
RohanK6 requested review from a team and KiroCrewCaptain as code owners November 14, 2026 18:19
@RohanK6
RohanK6 requested a review from dodgeblaster November 14, 2026 18:19
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: this adds one button under the recap, reuses the existing reopen and guarded-open paths, and removes nothing.

Notes

  • openSessionGuarded (MembersPageSidePanel.tsx:428-431) now restates the same check confirmSessionLeave makes. Build it as confirmSessionLeave().then(ok => ok && openSessionOnChatPage(key)) so the unsaved-edits question lives in one place.

[DESIGN-REVIEWED] 0c0092b

Description read

[DESCRIPTION-READ] 2c7d95b40b4f30d9cc81ddb901d68b52133238216f784925f3c3310c401e0fa1

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 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 0c0092b02e5b0a0e715d1bcfd5c8715d3eb84d68 — 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 maintainer decision on the base commit (2026-11-12, issue #36175) asks for this button, and the reopen reuses reopenCrewSession. The row click stays an in-place recap.

Notes

  • Item 5 — duplicate of openSessionGuarded (website/src/pages/members/MembersPageSidePanel.tsx:428): confirmSessionLeave now spells out the same "schedAtStakeRef.current() ? schedGuardRef.current() : …" check again, so one Schedules guard has two copies in the same hook. I counted 2 sites for the schedAtStakeRef.current() guard pattern. Subtraction: shrink openSessionGuarded to confirmSessionLeave().then(ok => ok && openSessionOnChatPage(key)), so only one copy of the guard is left.

What this change ships

Inventory (6 items) — 5 justified

Intent: let a Bot owner go from a session's recap on the Bot's Sessions tab into that session, reopening it first if it is closed. This is an ADDITION.

  1. An opened recap shows an Open session button, which opens /chat?sid=<key> after the unsaved-edits question — justified
  2. A closed session's button reads Reopen session: it reopens the session from its saved conversation, then opens it, and shows an inline error if the reopen fails — justified
  3. A closed session's recap shows a line above the button saying it is closed and that nothing runs again — justified
  4. A session on another crew shows a line naming that crew and no button — justified
  5. The side-panel hook exposes confirmSessionLeave and openSessionOnChatPage (one consumer each) — duplicate of openSessionGuarded's guard
  6. Eight new strings in 12 languages, plus updates to the crew-mode spec and the feature map — justified

[FIRST-PRINCIPLES-REVIEWED] 0c0092b

Description read

[DESCRIPTION-READ] d9a44f7c1b38c291d568aef20fdd0898a2adef6cf154916590cc99983655fc26

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 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The blind reader read Open session and Reopen session correctly and would press both, and the screenshots cover every new state except the short Reopening… label.

Notes

  • The other-crew line recap_open_remote ("This session runs on {{crew}}. Open it from that crew.") gives no way to get there. The blind reader said: "I don't know how to get to 'that crew'". Make the crew name a link to that crew, or name where the crew switcher is.
  • The reopen-pending label (recap_reopening, "Reopening…") is in none of the screenshots. Add one shot of the pending button so its look can be checked.
  • The screenshots show every recap with the same "Status: In progress" text and the same upload-race report, including the two Waiting rows. The blind reader said this "makes me trust the details less". Give each row its own recap in the screenshot setup, so the pictures show what a user would really see.

[UX-REVIEWED] 0c0092b

Description read

[DESCRIPTION-READ] 41b05115433b3bfd5123efd16b187d70efa3088a6bf29edeaf4a595e20218d97

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 0c0092b

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

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

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

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

GPT 6.1 flagged blocking issues on 0c0092b02e5b0a0e715d1bcfd5c8715d3eb84d68; Opus 5.5 adjudication downgraded every one of them. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

This comment is updated in place on each push.

Review details

BLOCKING -- website/src/pages/members/MateSessionsList.tsx:248 -- Polling can cancel navigation after a successful reopen

if (!mounted.current) return
Trigger: Reopen a closed worker without a terminal report while the Sessions poll completes before the resume response. The backend publishes the reopened slot before awaiting manager rebinding; the poll moves its row from Done to Waiting, unmounting the group-owned OpenSessionAction.
Outcome: The session reopens successfully, but the unmount check suppresses navigation even though the person stayed on the Sessions tab.
Anchor: defect
Fix: Own the pending reopen and navigation guard above the group-keyed rows, so regrouping preserves the action while leaving the tab still cancels navigation.

[BLOCK-MERGE-DOWNGRADED] 0c0092b
[GPT-REVIEWED] 0c0092b

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

F1 — LOW. I confirmed every condition the failure needs:

  • The rows sit inside per-group containers keyed by group (MateSessionsList.tsx:143-166). When a worker moves from Done to Waiting, its row remounts.
  • The unmount check MateSessionsList.tsx:248 then skips openOnChatPage.
  • By that point reopenCrewSession has already completed the reopen and called openCrewSession (CrewWorkerList.tsx:224-226). The session is live and active; only the route change is lost.

Recovery is visible and takes one click. expanded lives in the list (MateSessionsList.tsx:111,148), so the row stays expanded in its new group. The worker is no longer closed, so the button now reads "Open session" and goes straight to openOnChatPage (MateSessionsList.tsx:244). The real fix is costlier: the pending-reopen and navigation-guard state has to move up into the list, above the group-keyed rows. That is new cross-component state serving one rare race, and every future reader of the list carries it. That cost is larger than a one-click recovery.

[ADJUDICATION] 0c0092b02e5b0a0e715d1bcfd5c8715d3eb84d68 total=1 uphold=0 downgrade=1
DOWNGRADE F1 website/src/pages/members/MateSessionsList.tsx:248 reason=disproportionate-remedy
[GPT-ADJUDICATED] 0c0092b02e5b0a0e715d1bcfd5c8715d3eb84d68

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

@KiroCrewCaptain

KiroCrewCaptain commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: A person should decide

Why: the decider thinks the change is probably fine but estimates a 20% chance that this change introduces a defect, above the 12% limit for approving on its own.

Adds the Open/Reopen session button under the recap on a Bot's Sessions tab, which the 2026-11-12 maintainer decision asks for. It asks the page's unsaved-edits question first, then opens the session through the existing navigation, or reopens a closed one first with reopenCrewSession, the same call the chat page's Workers list makes; it moves the person only when the reopen took the view. A session on another crew gets a line and no button. Every new path has a test, the strings are in all 12 languages and the docs match the code; CI is green. The one real gap is a regroup race that can skip the navigation after a successful reopen: one extra click, no data loss. It and the small guard duplication are left as notes.

Tier: 2, held for a person: design-doc-gate: D.

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 0c0092b02e · 400 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 merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 14, 2026
@RohanK6
RohanK6 force-pushed the crew/conductor/open-session-36175 branch from 1c6e0b4 to 037142c Compare November 16, 2026 04:49
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 16, 2026
@RohanK6
RohanK6 enabled auto-merge (squash) November 16, 2026 06:01
@KiroCrewCaptain

Copy link
Copy Markdown
Collaborator

The design is signed off. A maintainer recorded it on main in docs/decisions/2026-11-12-a-bots-sessions-tab-opens-a-session-and-shows-the-task-it-was-last-given.md (#36187), so this PR now waits for a maintainer approval.

Review result on this head: nothing blocks. The diff matches that decision point by point. A row click still expands the recap. The recap has one button, which says "Reopen session" for a closed session. The unsaved-edits question comes before any reopen. A failed reopen shows an inline ErrorNotice, and a remote-crew row shows a line and no button. The button is a labelled type=button and uses aria-disabled while busy. All 8 new strings are in all 13 locale files. The tests resolve their own promises and use no sleeps or clocks. The PR reuses reopenCrewSession and its activated result, so a newer session pick still wins, and it adds no second reopen path.

Optional:

  • MateSessionsList.tsx:248: suppose the 10 s poll moves a closed row into another group while its reopen is still pending. The row remounts, and if (!mounted.current) return skips the navigation. The session reopens, but the person stays on the Members page. One more click recovers it. You could hold the pending reopen in MateSessionsList, which does not remount, or answer the open lane finding with an ai-review-disposition comment.
  • MembersPageSidePanel.tsx:434: no test runs the real confirmSessionLeave, so a version that always resolves true passes every test. A case in MembersPage.schedules.test.tsx, next to the driving-session one, would pin it: open a draft, press "Open session", answer Cancel, and assert there is no navigation.
  • MembersPageSidePanel.tsx:428-437: openSessionGuarded and confirmSessionLeave both hold the same Schedules-guard test. Writing openSessionGuarded as confirmSessionLeave().then(ok => { if (ok) openSessionOnChatPage(key) }) keeps one owner for it.

@RohanK6

RohanK6 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

Hello maintainers: this PR is ready for review. At 037142c readiness passes and auto-merge is armed.

  1. What it adds: the Bot Sessions tab recap gets one Open session button, as the 2026-11-12 decision records (docs: record that a bot's sessions tab opens a session #36187).
  2. A closed session reads Reopen session, says it is closed and that nothing reruns, and reopens from its saved conversation first.
  3. A session on another crew gets a line, not a button.
  4. Proof: en and de screenshots for each state are in the body, plus tests that fail on main.

Thank you for taking a look.

@iamwhatever
iamwhatever disabled auto-merge November 17, 2026 16:16
@iamwhatever

Copy link
Copy Markdown
Contributor

Hi @RohanK6, thanks for this work. Heads-up: #37915 takes a different approach to #36175, and the two PRs conflict.

New approach (owner decision, restated in #37915 (comment)):

  • The Bot page side panel gets a Sessions tab, after Dashboard. Dashboard stays the default and is unchanged.
  • A row click in that tab, or in Profile > Sessions, opens the session inside the side panel to read and chat. It no longer expands a recap in place. A Recap toggle and an "Open in chat" button sit in the session header.
  • The per-Bot "Show in my Sessions list" switch is removed; a stored value is ignored.

This replaces the recap "Open session" button from #37298, and the new decision entry supersedes the 2026-11-12 entry this PR is built on. So once #37915 lands, #37298 would no longer apply. Could you hold this PR (keep auto-merge off) until #37915 settles? Happy to hear if you see a case the side-panel flow misses.

@RohanK6
RohanK6 enabled auto-merge (squash) November 17, 2026 17:03
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 17, 2026
A Bot's Sessions tab is the only list of the sessions it dispatched,
and nothing on it opened one. The opened recap now carries one
button. Open session asks the page's unsaved-edits question, then
opens the session in the chat view. A closed session reads Reopen
session and is reopened from its saved conversation first, the way
the Workers list does; a failed reopen keeps the person on the page
and says so. A session on another crew gets a line instead of a
button.

Fixes #36175
@RohanK6
RohanK6 force-pushed the crew/conductor/open-session-36175 branch from 037142c to 0c0092b Compare November 17, 2026 19:19
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 17, 2026
@RohanK6

RohanK6 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #37915 (merged 2026-11-17 23:59Z by a maintainer), which closed #36175. It replaces the in-place recap this PR added a button to: a row now opens the session in the side panel's Sessions tab, with Reopen session for a closed one and no open for a remote one. Rebasing this PR would put a second, conflicting way in onto that design. Thank you for the reviews.

@RohanK6 RohanK6 closed this Nov 18, 2026
auto-merge was automatically disabled November 18, 2026 00:16

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A Bot's Sessions tab has no way to open a worker session

3 participants