Skip to content

fix(sidebar): show crew groups whenever Chat on a crew is on - #18767

Merged
iamwhatever merged 1 commit into
mainfrom
fix/crew-groups-one-flag
Oct 10, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/crew-groups-one-flag

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: With Chat on a crew on, the Sessions sidebar shows a group per connected crew, so a chat started on a crew has a place to come back to.

On a real two-machine test the user opened a chat on a crew ("hello · On shizuka"), but the local Sessions sidebar showed no crew groups at all. No "shizuka" group, and the remote sessions that used to show were gone.

Why it matters

Anyone who turned on Chat on a crew but not Remote crew sessions can start a chat on another machine and then lose it. The crew window closes, and nothing in the sidebar leads back.

Not a goal

  • Changing what a crew group shows, or how it looks.
  • Showing crew groups in board (column) view. Board view already leaves peer rows out and says how many ("N remote sessions are not shown in board view").
  • Spaces inside crew groups (CrewGroups.tsx), which another PR handles.

What changed (motivation → approach → change)

Symptom: chat on a crew works, but the sidebar has no crew group.

Cause: two preview switches held two halves of one feature. Chat on a crew (mc-preview-remote-crew-chat) held "New chat on crew". Remote crew sessions (mc-preview-instance-sessions) held the crew groups in sessionSources.ts. One on and one off gives exactly this.

Change: one switch. Chat on a crew now holds both halves, read through a new useRemoteCrewChat() hook and written through setRemoteCrewChat() in previewFlags.ts. The old key still counts as on, so nobody loses the feature. Turning the switch off clears both keys. The Remote crew sessions card is gone. The Chat on a crew text now says it lists crew sessions too, and it shows under the label instead of behind an info tip.

Board view was checked and is not the cause here. It already says how many peer rows it leaves out.

Side effects of removing the card:

  • Old highlight links to the card land on Chat on a crew.
  • Chat on a crew takes the old card's place on the guide's never-point list, because it now does what that card did.
  • settingsRegistry.gen.ts, settings-registry.generated.json, ui-index.generated.json and en-XA are regenerated. remote-crew.md, the feature map and the sidebar paragraph of history.md are updated.

Backwards compatibility

Compatible: a device with either key set to 1 still has the feature on, and old highlight ids still resolve. A device that had only the old Remote crew sessions switch on now also gets New chat on crew: that is the one-switch change itself.

Reader: website/src/pages/chat-sidebar/sessionSources.ts:useSessionSources -- crew page -- reads useRemoteCrewChat(), which counts the old key; test shows the crew groups with only Chat on a crew on
Reader: website/src/pages/settings/FeaturePreviewsSection.tsx:FeaturePreviewsSection -- crew page -- one card now; tests has one Chat on a crew switch for both crew halves, and no second card, reads the retired instance-sessions key as on, and clears it when turned off
Reader: website/src/hooks/useSettingHighlight.ts:LEGACY_ID_EXACT -- crew page -- both old ids map to developer.chat-on-a-crew; test maps both peer-session preview ids to the Chat on a crew card
Reader: website/src/guide/findTargetPolicy.ts:SENSITIVE_IDS -- chat -- now names developer.chat-on-a-crew; test test_instances_settings_are_guidable_and_the_trust_root_is_not
Reader: src/kiro_crew/guide_catalog.py:_EXCLUDED_SETTING_IDS -- chat -- same id swap, kept a superset of the browser list
Reader: website/src/i18n/locales/.json:featurePreviewsTab.remote_instance_sessions -- release -- key had one reader (the removed card); the deadKeys and catalog parity tests pass
Reader: website/src/test/
.test.tsx:PREVIEW_INSTANCE_SESSIONS -- release -- the constant is kept, so the 30-odd tests that seed it still turn the feature on

Tests

  • ChatSidebar.machineGroups.test.tsx › shows the crew groups with only Chat on a crew on: seeds only the Chat on a crew key and expects the crew group with its peer row and relay slot. Red on main.
  • previewSurfaces.test.tsx › has one Chat on a crew switch for both crew halves, and no second card: red on main.
  • previewSurfaces.test.tsx › reads the retired instance-sessions key as on, and clears it when turned off: red on main.
  • The info-tip count in the ingress census goes from 4 to 2: one card fewer, and the Chat on a crew text now shows under its label (the UX lane's blocker on an earlier head) instead of behind an info tip.
  • settingHighlightAliases.test.ts, test_remote_crew_doc.py and test_guide_ui_find.py follow the id and card change.

Red on main: these test files were copied onto a detached origin/main worktree and run there. 4 failed, the ones above. On the branch: 243 related frontend spec files (3981 tests) and 39 related backend files (2196 tests) pass. tsc -p tsconfig.app.json and eslint on the changed files are clean.

Determinism: the new tests use the file's existing fixtures and mocks, with no timers or clock reads. The new sidebar test's waits name a 5 s ceiling for the two chained queries. ChatSidebar.machineGroups.test.tsx + previewSurfaces.test.tsx were run 5 times with --sequence.shuffle: the new tests passed every time. Three older tests in crew is preview-gated end to end fail under some shuffle seeds; they fail the same way on main (seed 7), so that is not from this PR.

Manual verification

website/scripts/capture-crew-groups-one-flag.mjs was run against a built dist from main and from this branch, both seeded with only mc-preview-remote-crew-chat=1 and one connected crew "shizuka". The script is not committed. Main: crew group "shizuka" in the sidebar: no. Branch: YES.

Screenshots / video

Sidebar, only Chat on a crew on. Before (main): no crew group.

before-1-sidebar

After: the shizuka group with its session.

after-1-sidebar

Settings > Developer > Feature Previews

Before: two cards.

before-2-feature-previews

After: one card, its text shown under the label.

after-2-feature-previews

Related Issues

Closes #18750

Pattern harvest

Not generalizable: two preview flags were added for the two halves of one feature. It is a one-off product split, not a code pattern a rule can match.

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

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 10, 2026 07:27
@iamwhatever
iamwhatever requested a review from buluoray October 10, 2026 07:27
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Check that people who had only "Remote crew sessions" on are fine with now also getting the "New chat on crew" entry. useRemoteCrewChat() turns on both halves for them.

[DESIGN-REVIEWED] f1dd2b3

Description read

[DESCRIPTION-READ] 82eacf18d4ad90ff8b4a9215335d8932c8d95a8f3a975bacaa8e204c667b9b28

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

Check that someone who had only Remote crew sessions on now sees "New chat on crew" in the create menu without having turned it on.

[UX-REVIEWED] f1dd2b3

Description read

[DESCRIPTION-READ] ca1ea011988320541ffbf83cd1f89abd6f02f490647e4cf6af47142bf963dcbe

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

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f1dd2b3

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

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] f1dd2b3

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

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

@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 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of f1dd2b365437abef9119b35ffccfe0146fbde2ca — 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: PASS

Devices that turned on only the old "Remote crew sessions" switch now also get "New chat on crew", which they never chose. Confirm that's intended.

Not justified as shipped

  • Item 3 — undeclared: the description says "a device with either key set to 1 still has the feature on". But create.ts now reads useRemoteCrewChat(), so the old key alone also turns on dispatching a chat to another machine, not just listing that machine's sessions.
  • Item 5 — rides along: the text moves from hint= to description=, which reverses feat(settings): move explanatory help behind an info tip #15823's info-tip placement for this one row. Because of this, INFO_TIP_COUNT drops 4→2, not the "4 to 3" the description states.

What this change ships

Inventory (8 items) — 6 justified

Intent: let someone who started a chat on a crew find it again in the Sessions sidebar. This is a FIX.

  1. With only Chat on a crew on, the sidebar shows a group per connected crew — justified
  2. The "Remote crew sessions" card is gone from Feature Previews; one switch holds both halves — justified
  3. The old instance-sessions key still turns on the whole feature, including "New chat on crew" — undeclared
  4. Turning Chat on a crew off also clears the old key — justified
  5. Chat on a crew's text is reworded and shown under the label instead of behind an info tip — rides along
  6. Old highlight links for the removed card land on Chat on a crew — justified
  7. The guide no longer points users at Chat on a crew; it takes the old card's sensitive slot — justified
  8. The docs, settings registry, UI index and locales drop the old card; remote-crew.md adds a board-view sentence — justified

[FIRST-PRINCIPLES-REVIEWED] f1dd2b3

Description read

[DESCRIPTION-READ] b74ac6ef872f0bf2db22e201b46d0e51f0de72a010f70198106a1a300fe960f8

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 added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the fix/crew-groups-one-flag branch from 7384309 to 8c865d3 Compare October 10, 2026 09:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 10, 2026
@iamwhatever
iamwhatever force-pushed the fix/crew-groups-one-flag branch from 8c865d3 to 6ccdda8 Compare October 10, 2026 10:15
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 10, 2026
Fold the "Remote crew sessions" preview into "Chat on a crew": one switch
now gates both "New chat on crew" and the per-crew groups in the Sessions
list. With the two split, a user could start a chat on a crew and find no
crew group to return to it from.

The retired mc-preview-instance-sessions key still reads as on, so a
device that turned it on keeps the feature; turning the one switch off
clears it. Old highlight ids land on the Chat on a crew card, and that
card inherits the retired card's place on the guide's never-point list.

Closes #18750
@iamwhatever
iamwhatever force-pushed the fix/crew-groups-one-flag branch from 6ccdda8 to f1dd2b3 Compare October 10, 2026 11:03
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 10, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 3: the old key alone also turns on New chat on crew — rebutted span=7d5c1061a77f

This is the goal, not a side effect: one switch holds both halves, so whatever turns the feature on turns on both.
The split is the bug: one half on and the other off is exactly the two-machine report in #18750.
A device with only the old key set chose to see a crew's sessions; New chat on crew is the other half of that same feature.
The description's Backwards compatibility line now says this in words.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 5: hint moved to description, INFO_TIP_COUNT 4 to 2 — fixed span=dfa2a81a40ee

The move is the fix for the UX lane's BLOCK on head 6ccdda8: with one switch now holding both halves, its text must be readable without hovering.
It touches only the Chat on a crew row; every other card keeps #15823's info-tip placement.
The stale "4 to 3" line in the description now reads 4 to 2 and says why.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention 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 Oct 10, 2026

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

Verdict: approve. One preview switch now holds both halves of "Chat on a crew". Default users see no change, and nothing blocking survived verification.

What it brings

Someone who turned on Chat on a crew could start a chat on another machine and then find no crew group in the Sessions sidebar to get back to it. The second half lived behind a different switch, Remote crew sessions. Now one switch shows both the "New chat on crew" entry and the per-crew groups. Feature Previews has one card instead of two, and the card's text shows under its label.

Verified (at f1dd2b365437abef9119b35ffccfe0146fbde2ca)

  • Default users are unchanged. useRemoteCrewChat() (website/src/hooks/usePreviewFlag.ts:43-46) is current || legacy. With neither key set it is off, so useInstanceSessions gets enabled=false (website/src/pages/chat-sidebar/sessionSources.ts:35, :68-70) and sends no per-crew request, the same as before.
  • Upgrade keeps the feature on. A device with only the old mc-preview-instance-sessions=1 still reads as on through the same hook. Its one new effect is that the create menu gains "New chat on crew", which is the point of the change and is stated in the description.
  • There are exactly three readers, and all go through the hook: create.ts:198, sessionSources.ts:35 and FeaturePreviewsSection.tsx:135. No other source file reads either key directly. PREVIEW_INSTANCE_SESSIONS is still exported only so existing test fixtures keep working.
  • Turning it off really turns it off. setRemoteCrewChat(false) (website/src/utils/previewFlags.ts:178-182) clears both keys. Without that, a device carrying the old key would stay on behind a switch that reads off. If the storage write fails, the function returns false and the toggle keeps showing on, so the failure is visible (fail-closed).
  • Old highlight links still land on the card. Both retired ids map to developer.chat-on-a-crew (website/src/hooks/useSettingHighlight.ts:60-61).
  • The guide's never-point list stays in sync. The browser list (website/src/guide/findTargetPolicy.ts:51) and the gateway list (src/kiro_crew/guide_catalog.py, _EXCLUDED_SETTING_IDS) swap the same id, so the gateway list is still a superset of the browser's.
  • Translations are updated. Every locale updates chat_on_a_crew_desc and drops the two keys the removed card used. The old wording ("not listed in this dashboard's sessions yet") is gone from all of them.
  • Specs and docs match. The feature-map peer-session row, the developer tab row ("Six of the seven previews"), the sidebar paragraph in docs/system-specs/modules/history.md and src/kiro_crew/docs/remote-crew.md all name the single switch. I found no stale reference to the retired card in docs or source.
  • No recorded decision is contradicted. Nothing in docs/decisions/ covers preview-switch placement or crew-group gating.
  • Relationship with #18766 (crew folders in a crew group, same sidebar):
    • git merge-tree --write-tree reports no conflicts between the two heads, and neither head conflicts with main.
    • On the merged tree, the related vitest files pass (5 files, 77 tests) and tsc -p tsconfig.app.json is clean.
    • #18766's tests still seed the old key, which this PR keeps reading as on, so it does not break them.
    • Suggested order: this PR first. It is the fix that makes crew groups appear for Chat on a crew users, and #18766 only shows up once a group renders. Neither PR depends on the other at the code level. Re-run CI on whichever lands second.

Non-blocking follow-ups

  • One reader has no test. Mutating create.ts to read only the new key leaves every related suite green (previewSurfaces, ChatSidebar.machineGroups and five other crew sidebar files: 162 tests). So "a device with only the old switch gets New chat on crew" is stated but not tested. A test that seeds only the old key and checks the create menu would cover it.
  • A side effect of the id swap. Because developer.chat-on-a-crew is now on the never-point list, the guide can no longer walk someone to this switch. That matches what the old card had, but the description could say so.

Tests and mutations

  • I ran the targeted tests only:
    • vitest: ChatSidebar.machineGroups, previewSurfaces and settingHighlightAliases, 59/59 passed.
    • pytest: test_remote_crew_doc.py and test_guide_ui_find.py, 155 passed.
  • Mutations (each restored afterwards, worktree clean):
    • Dropping the old key from useRemoteCrewChat turns red reads the retired instance-sessions key as on, and clears it when turned off and seven older crew-group tests in ChatSidebar.machineGroups (renders Local and one group per connected crew…, keeps the selection when the crew group holding it collapses, and others).
    • Not clearing the old key on off turns red reads the retired instance-sessions key as on, and clears it when turned off.
    • Gating sessionSources.ts on the old key again turns red shows the crew groups with only Chat on a crew on.
    • Reading only the new key in create.ts turns nothing red (see follow-ups).
  • CI at this head: 98 success, 10 skipped, 0 failure, 0 pending. Auto-merge is off and there are no reviews yet.

Not verified

  • I did not run the full frontend or backend suites; CI covers those.
  • I did not re-check the regenerated settingsRegistry.gen.ts, settings-registry.generated.json and ui-index.generated.json against their generators beyond the tests above.
  • I did not look at the screenshots against a live two-machine setup.

@iamwhatever
iamwhatever merged commit 7e50b6e into main Oct 10, 2026
201 of 206 checks passed
@iamwhatever
iamwhatever deleted the fix/crew-groups-one-flag branch October 10, 2026 19:06
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 10, 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.

Crew groups missing from the sidebar while Chat on a crew is on

2 participants