Skip to content

feat(mates): hide a crewmate's sessions from the person's lists behind a preview - #30220

Merged
iamwhatever merged 1 commit into
mainfrom
feat/hide-mate-dispatched-sessions
Nov 5, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/hide-mate-dispatched-sessions

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Behind a new Feature Preview, the chats a Bot opens leave your own session lists and show on that Bot's Sessions tab instead.

Today every chat a Bot (crewmate) opens lands in your sidebar, Recents and grid, next to the chats you opened yourself. A busy Bot fills your list with its work.

Why it matters

The accepted RFC rfc-crewmate-workers-under-the-crewmate.md (path B, picked in #27837, accepted via #28858) moves a Bot's chats under the Bot. This is step 6 of that plan. The earlier steps already shipped: the mate_root stamps (#26952), the mate session routes (#28869), hidden workers' approvals and questions reaching the Bot's chat (#29276), and the Bot profile Sessions tab (#28931). Without this step those chats stay in your lists.

Not a goal

  • Turning the preview on by default, or retiring it.
  • Closing a Bot's chats for it (a later step of the RFC).
  • Any change to Crew Mode (Ultra Mode) workers, which were already hidden.
  • Any change to History or search: they still find every chat.

What changed (motivation → approach → change)

A Bot's chats crowd your lists. Every chat a Bot opens carries a mate_root stamp, the key of the Bot's own chat. So the lists can drop those rows by that stamp, the same way they already drop Crew Mode workers by crew_root. The Bot's own chat has no stamp, so it stays.

A new preview, "Bot sessions on the Bot's profile" (mate_sessions, default off), turns the rule on. It is registered in src/kiro_crew/config/sections_dashboard.py and website/src/utils/previewFlags.ts, read through useMateSessionsHidden in website/src/hooks/usePreviewFlag.ts, and labelled in every website/src/i18n/locales catalog. The settings search index src/kiro_crew/docs/settings-registry.generated.json and the find_ui index src/kiro_crew/docs/ui-index.generated.json are regenerated for the new row, and so is config-baseline.json. On the server, crew_mode.list_view leaves mate_root rows out of a person's default GET /api/chat/slots read; crew=all and agent reads still get every row. In the dashboard, crewModeView drops a row whose mate_root names a live Bot chat. autoOpenRows never opens one, and unread counts skip them. The sidebar, flyout, Recents and command center all read that same rule.

A hidden chat you open from the Sessions tab, History, search or a link shows the worker breadcrumb. Its first crumb names the Bot and opens the Bot's profile on its Sessions tab. On a phone the breadcrumb sits under the top bar, so the transcript now keeps its top gap there. Before, the breadcrumb covered the first rows; Crew Mode workers had the same bug on main.

Backwards compatibility

Compatible: the preview is off by default, and with it off every list and read answers as before.

Reader: src/kiro_crew/crew_mode.py:list_view -- chat (person GET /api/chat/slots) -- mate_root rows left out only with the preview on; crew=all and agent reads keep them (test/test_chat_slots_crew_view.py)
Reader: website/src/lib/crewMode.ts:crewModeView -- chat (sidebar, flyout, Recents, grid) -- rows hidden only with the preview on (crewMode.test.ts)
Reader: website/src/store/dashboard/unread.ts -- chat (unread badge) -- hidden rows not counted only with the preview on
Reader: website/src/pages/members (Bot Sessions tab) -- crew page -- reads its own mate session route, so it still lists every chat
Reader: History and search -- chat -- read saved sessions, not the person list, so they still find every chat

Tests

  • test/test_chat_slots_crew_view.py: the person read drops mate_root rows only with the preview on; crew=all and agent reads keep them; the Bot's own chat stays.
  • website/src/lib/crewMode.test.ts: crewModeView and autoOpenRows hide a live Bot's chats only with the preview on.
  • website/src/components/crew/CrewWorkerBreadcrumb.test.tsx: the Bot crumb names the Bot and goes to /members?member=<name> asking for the Sessions tab, not the main chat.
  • website/src/pages/members/MembersPage.loop.test.tsx: that request opens the named Bot's profile on Sessions; a plain member link leaves the profile closed.
  • website/src/test/previewSurfaces.test.tsx: the Feature Previews row count includes the new row.
  • Local gates: pre_push_gate.py passed; type check passed; semgrep found nothing; the related frontend tests passed. Some backend tests fail on this host (enterprise profile, ~/.mcp.json). The same tests fail the same way on clean main.
  • Local GPT and Opus reviews: GPT's two blocking findings (phone top gap, Bot crumb target) are fixed here, and a GPT check of the fix passed. Opus found nothing.

Gate proof: tree 1547fdf9cbc1; ran 24; skipped none

Manual verification

I ran the built dashboard against stubbed APIs in a headless browser (Playwright, scripted). It checked: the switch is in Settings › Developer › Feature Previews; with the preview off a Bot's chat is listed, with it on it is not; a Bot's chat opened by link shows the breadcrumb naming the Bot, on desktop and on a phone. The phone top gap was checked in code, not in pixels: the stubbed chat had no messages.

Screenshots / video

The new switch in Feature Previews:

Feature Previews row

Sidebar with the preview off (the Bot's chat "Fix the flaky test" is listed) and on (it is gone; "Plan my week" stays):

Preview off

Preview on

A hidden chat opened by link, with the breadcrumb back to the Bot (desktop, phone):

Breadcrumb, desktop

Breadcrumb, phone

Related Issues

Closes #30023

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; see the Licensing section of CONTRIBUTING.md.

settings-debug

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

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of ba8952bc3ec5a1a4cd95758a58d58e010dab3e26 — 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

Every user-visible item matches step 6 of the accepted RFC rfc-crewmate-workers-under-the-crewmate.md, and it all sits behind a preview that is off by default. One internal parameter has no consumers.

Notes

  • Item 3 — zero consumers: in list_view(rows, view, *, agent, cfg: Any = None), nothing passes cfg. A grep for list_view( finds one caller, dashboard/chat_api/slot_detail.py:108, and it does not pass it. The tests patch _live_cfg instead. Subtraction: delete list_view's cfg parameter and call mate_sessions_hidden() with no argument.

What this change ships

Inventory (8 items) — 7 justified

Intent: let a person turn on a preview so that the chats a Bot opens leave their own lists and show on the Bot's Sessions tab instead. This is an ADDITION.

  1. New Feature Previews switch "Bot sessions on the Bot's profile", default off — justified
  2. With the preview on, a Bot's chats leave the sidebar, flyout, Recents, grid and command center — justified
  3. With the preview on, a person's GET /api/chat/slots drops mate_root rows; crew=all and agent reads keep them — zero consumers (the unused cfg parameter)
  4. Unread counts skip the hidden chats — justified
  5. The page never opens a hidden chat on its own — justified
  6. A hidden chat opened by link, History or search shows a breadcrumb that names the Bot and goes back to it — justified
  7. The Members page opens the Bot's profile on its Sessions tab when the breadcrumb asks for it — justified
  8. On a phone, the transcript keeps its top gap under any worker breadcrumb (this also fixes the same overlap for Crew Mode) — justified

[FIRST-PRINCIPLES-REVIEWED] ba8952b

Description read

[DESCRIPTION-READ] a8aa70a87b63e65bb0143ac620e1c81bae8f538ae548bed06da556a6c7ff4595

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the change is off by default behind a preview, easy to reverse, and the screenshots cover this revision's new surfaces.

Notes

  • The server and the dashboard hide different rows. list_view drops every mate_root row (not (hide_mates and r.get(MATE_ROOT_FIELD))), but crewModeView drops a row only while its Bot chat is live (!mates.has(mate)). So once a Bot chat is closed, a script or curl reading GET /api/chat/slots still loses that chat's sessions, which the dashboard lists again. Use the dashboard's live-chat rule on the server too, or say in the docstring that the server rule differs on purpose.
  • Only the dashboard reads the preview through the browser's local copy. The server reads the gateway config, which the dashboard syncs to. A person who turns it on in one browser changes the default list for every person client of that gateway. That is fine for a developer preview, but the flag's note should say it is gateway-wide.

[DESIGN-REVIEWED] ba8952b

Description read

[DESCRIPTION-READ] 10fb6aa14eb7b54caa71b6126594ac9aa23748e6ff52482b972cd180f9461816

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Nothing blocks. The blind reader understood both the preview switch and the Bot crumb correctly and would use them.

Notes

  • With the preview on, the Bot's chats leave the sidebar and nothing in the list says where they went. The blind reader on shot-03: "Nothing on this screen tells me where they went", and "I never see a Bot profile or a Sessions tab, and I didn't know where to find one." Add a note or link on the Bot's own chat row pointing to its Sessions tab.
  • No screenshot shows where the "ada" crumb leads: the Mates page with the Bot's profile already open on Sessions (the openProfile('sessions') effect in MembersPage.tsx). Attach one.
  • mate_sessions "Bot sessions on the Bot's profile" calls the same thing "sessions" in its label and "chats" in its summary, "Moves a Bot's chats to its Sessions tab". The reader flagged the drift. Pick one word, e.g. "Bot chats on the Bot's profile".

[UX-REVIEWED] ba8952b

Description read

[DESCRIPTION-READ] da8abb79ac85c28e2a85a6c49e4cd14883b4bb40511fe778d20c7f600b5da356

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 Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ba8952b

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

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

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ba8952b

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

@iamwhatever
iamwhatever force-pushed the feat/hide-mate-dispatched-sessions branch from a020b60 to 751aea4 Compare November 5, 2026 07:56
@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 5, 2026
@iamwhatever
iamwhatever force-pushed the feat/hide-mate-dispatched-sessions branch from 751aea4 to 3075422 Compare November 5, 2026 08:44
@github-actions github-actions Bot added readiness: checking Automated validation is still running 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: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 5, 2026
@iamwhatever
iamwhatever force-pushed the feat/hide-mate-dispatched-sessions branch from 3075422 to b9c0853 Compare November 5, 2026 10:00
@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: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 5, 2026
…d a preview

Step 6 of rfc-crewmate-workers-under-the-crewmate.md. A new Feature
Preview, "Bot sessions on the Bot's profile" (mate_sessions, default off),
takes every session whose lineage reaches a mate thread (mate_root) out of
the person's lists:

- server: list_view drops mate_root rows from a person's default
  GET /api/chat/slots read; crew=all and agent reads keep every row.
- client: crewModeView drops a row whose mate_root is a live mate thread
  of the full slot store (before the Crew Mode early return, so that
  branch is unchanged); autoOpenRows never opens one; the unread count
  skips them. Sidebar, flyout, Recents and command center read the same
  rule.
- A hidden session opened from the Sessions tab, History, search or a
  link shows the worker breadcrumb; its root crumb names the crewmate and
  opens its profile on the Sessions tab. On a phone the transcript
  keeps its top gap under the breadcrumb (Crew Mode workers too).

The mate thread itself carries no mate_root and stays listed. With the
preview off nothing changes.

Closes #30023
@iamwhatever
iamwhatever force-pushed the feat/hide-mate-dispatched-sessions branch from b9c0853 to ba8952b Compare November 5, 2026 17:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running 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 labels Nov 5, 2026
@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 Nov 5, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) November 5, 2026 19:26
@iamwhatever
iamwhatever merged commit f84af3b into main Nov 5, 2026
98 checks passed
@iamwhatever
iamwhatever deleted the feat/hide-mate-dispatched-sessions branch November 5, 2026 19:31
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 5, 2026
@buluoray

buluoray commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]: Reviewed ba8952b after it merged. The preview is off by default (dashboard.feature_previews.mate_sessions, default false), and with it off every list and count is unchanged. Each new guard is pinned by a test that turns red when the guard is removed. With the preview on, four gaps are still true on main and should close before the preview turns on by default: the Session Dashboards page drops a hidden mate session's approval or question, a hidden session's unread does not reach the mate, the crew-mode spec row is stale, and the server and client hide different rows. They are filed in #30721 with acceptance criteria.

JiaDe-Wu added a commit to JiaDe-Wu/KiroCrew that referenced this pull request Nov 6, 2026
…reads mate_root"

crew-mode.md still says no list reads mate_root and mate_dispatched_by,
and no row covers the Bot sessions preview that kirodotdev#30220 put behind
dashboard.feature_previews.mate_sessions. Two lists read the stamps with
it on: crew_mode.list_view on the server and crewModeView in the
dashboard.

The new row records what the code does, including that the two halves
hide different rows (the server drops every mate_root row, the dashboard
only while the Bot's thread is live), that the setting is stored in the
gateway config so it applies gateway-wide, and the breadcrumb a hidden
session shows. The Bot thread row now points at it.

Refs kirodotdev#30721
bolichen97 pushed a commit that referenced this pull request Nov 9, 2026
…ll-open notice (#31299)

(cherry picked from commit 16baf71)

Backport note: dashboardSlice.ts keeps release/0.12.0's `export { selectPersonSlots }` line; main's adjacent `selectLiveMateThreads` export comes from #30220, which is not on release.
bolichen97 pushed a commit that referenced this pull request Nov 9, 2026
…a timed-out close back (#31312)

(cherry picked from commit 53eb62e)

Backport note: the ChatSidebar.tsx and dashboardSlice.ts import lines keep release/0.12.0's crew-mode imports; main's adjacent useMateSessionsHidden, mateSessionsHidden and selectLiveMateThreads come from #30220, which is not on release.
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.

Crewmate workers step 6: hide a mate's sessions from the person's lists behind a preview

3 participants