Repository navigation
feat(folders): default crew for new chats in a folder - #21614
koenvincent wants to merge 2 commits into
Conversation
8c468b1 to
2560276
Compare
2560276 to
ec64497
Compare
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The committed screenshots show every added control and state in light and dark. In this fork lane no first-time reader has seen them, so whether users understand them is still unknown. Pushing the branch to this repo runs the blind read. Notes
[UX-REVIEWED] 35e6d9b Description read[DESCRIPTION-READ] 03c2e84dc647f86d8ec582236cc72ae2ab36236db85af1015503d5ef563a0cc0 That sha256 names everything this verdict read: the PR description, plus the 25 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 |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. It is an additive, optional field that copies the existing Notes
[DESIGN-REVIEWED] 35e6d9b Description read[DESCRIPTION-READ] 385d90480fbbc3b15bb6191967fdd909f6b08da6e1a4163436361389edcf4345 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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the folder crew is opt-in, defaults to Local, sits behind a preview, and reuses the existing New chat on crew create and the What this change shipsInventory (10 items) — 10 justifiedIntent: let a person pin a folder to a crew so its New chats start there and never land on Local by mistake. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 35e6d9b Description read[DESCRIPTION-READ] dcdf6158882fdafeaca85cae6fca206f2707e479f678d0bae89c43d4e31fc6f3 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
ec64497 to
769cc14
Compare
769cc14 to
1c6fcd9
Compare
|
Review round on ec64497, all addressed at 1c6fcd9. Nothing deferred. GPT 6.1 (blocking): the crew route dropped the tab gesture. Fixed. Design (CONCERNS): Opus (advisory) and UX Watch: on a phone an offline crew was a dead end. Fixed. While the folder's crew is offline, the phone's session menu offers Start this chat on Local instead right under New chat in {folder}; it starts a local chat in that folder and the folder keeps its crew. The menu subscribes to the live crew set, so the item follows a crew that drops or comes back. UX Watch: the offline notice looked like a failure. Fixed on both surfaces. The sidebar uses UX evidence gaps. Every one now has a frame, from the committed capture script, which asserts each claim in the DOM:
UX suggestion: the hint's ambiguous "it". Taken: "Moving an existing chat here keeps it where it runs." in all 12 catalogs. Checks: 853 frontend tests across the 32 suites that touch these surfaces, |
1c6fcd9 to
cac1ffb
Compare
cac1ffb to
025d1c3
Compare
|
CI on
Backend shard 2 is the Checked locally:
Nothing else changed, and the 16 screenshots in the description now point at the new head. |
13eb558 to
bddf9b2
Compare
|
HOLD (human review) at bddf9b2. I found no defect. A PATCH refusal returns before the change is recorded, and a failed or offline crew create never falls back to Local. All AI lanes pass and every check on this head is green. It is held because it adds a new authorization rule (refuse_principal_default_crew, called at create and PATCH), and because the new field picks which peer machine runs a folder's chats. Both are reserved for a human maintainer. Also open for that maintainer:
— crew-pr-reviewer (r121) |
bddf9b2 to
2dba8e2
Compare
|
@iamwhatever thanks for r121. The three notes with no reply are fixed in 2dba8e2. The PR is still 2 commits on the same base.
Checks: black, isort, flake8, mypy and the repo gates on the backend; the typecheck, eslint and both i18n checks on the frontend. The 19 affected frontend test files pass (198 tests). I re-took all 22 frames from a fresh build, and the script's own checks pass. Still for a maintainer: the human review of the new authorization rule and the field that picks a crew, and @bolichen97's ruling on the tab gesture. |
|
Shard 2 on 2dba8e2 was mine: the shared |
|
|
|
|
Human design review is required before this PR can merge. Making a folder crew the default changes product behavior and needs explicit maintainer approval. This comment records the design gate only; it is not a code defect. |
|
HOLD at ce2985a for a maintainer. I found no defect in the backend gate and routes. I did not re-read the frontend on this head. Our r121 items are fixed: the sidebar 'no longer registered' notice has a capture, the Local action now sits inside the notice, and both person-only refusals share Blockers:
What clears it: a maintainer approves the design and the new gate, and the UX lane re-runs on the head and reviews it. — crew-pr-reviewer (r123) |
|
|
|
|
Hold at 35e6d9b for a maintainer. I found no defect in the gate or the routes, and every check on this head is green. Our r123 UX-gap item is cleared: the UX lane reviewed this head and passed. The earlier GPT and Opus findings are fixed with tests. Blockers:
The UX notes on this head (the doubled Local remedy, the unclear "them", the phone item not naming the crew) and the Design note on the Backwards compatibility lines are copy fixes, not blockers. What clears it: a maintainer approves the design and the new gate. — crew-pr-reviewer (r133) |
A chat folder gains an optional `default_crew`: the instance id of one registered crew, "" meaning Local. It is written by create and PATCH exactly like `default_agent` (stripped, capped at 128 characters, a non-string reads as Local), a PATCH that omits it leaves it alone, and an empty folder that carries one is kept by the cleanup. The gateway only stores and returns the field; the dashboard decides what a folder's New chat does with it. The MCP folder tools cannot set it, since it chooses which machine runs the folder's future chats.
Folder settings gains a Default crew picker next to Default agent:
Local, or one registered crew with its online state. It is shown only
while the Chat on a crew preview is on.
With a crew set, the folder's New chat (the folder `+`, the menu rows,
the board columns and the phone's "New chat in {folder}") does what
"New chat on crew" does for that crew. An incognito or temporary request
keeps its memory mode. A crew that holds no live tunnel is reported
inline and starts nothing; the notice offers Local for that one chat and
the folder keeps its crew. With the preview off the pin is ignored.
Moving a session into the folder never moves it to the crew, and the
setting does not inherit down to subfolders.
The create that "New chat on crew" runs moves to
pages/chat-sidebar/folderCrew.ts so both routes share it.
|
@bolichen97 to make the design ruling you recorded on 10-23 quick, this is the decision it needs: May a chat folder carry a With conductor remote dispatch merged, one more point for the ruling: this default applies only to chats a person opens in the folder. It does not touch If yes, I will rebase and ask for the fork workflow approval once. If no, I will close it. |
|
@bolichen97 friendly ping on the design ruling from 10-23: may a folder carry an owner-only |
Problem / Motivation
Goal: A chat folder can name a default crew, so every new chat started from that folder runs on that crew instead of landing on Local by mistake.
With the Chat on a crew preview, New chat on crew creates a session on a peer crew. Someone who keeps one sidebar folder per stream of work that always runs on the same crew still has to go through New chat on crew and pick the crew every time. A chat started with the folder's own New chat lands on this machine, and its first turn has already run here.
Why it matters
Starting a chat on the wrong machine is not undoable: the first turn runs there, with that machine's agents, files and credentials. A folder that always means "this crew" should say so once.
Not a goal
What changed (motivation → approach → change)
Goal: a folder-level answer to "where does a new chat start". The existing per-folder Default agent is the pattern, so the field, its validation and the picker follow it.
default_crew: an instance id string,""= Local. Create and PATCH write it likedefault_agent(stripped, capped at 128 characters viadashboard/chat_folder_default_crew.py; a non-string,nullincluded, reads as Local; a PATCH that omits it leaves it alone). A folder that carries one is kept by Clean up empty folders. The gateway only stores and returns it. Only the person picks it, because it chooses which machine runs the folder's future chats: the MCP folder tools cannot set it, and create and PATCH answer 403default_crew_forbiddento an app, crew-member or internal-auth caller that sends a non-empty value, the waysteering_dirsalready does (clearing to""stays allowed on a folder the caller owns).touched).hooks/folderCrew.tsdecideslocal | crew | offlineper folder.createChatInFolder(the single sink behind the folder+, the menu rows and the board columns) and the phone's "New chat in {folder}" ask it first.crewruns the same create as New chat on crew, which moved into that module so both routes share one implementation; an explicit incognito/temporary request keeps its memory mode. While the create runs (a capabilities check, then the peer's create: seconds) the folder says Starting a chat on … in the info tone; a second click on the same folder starts nothing more, and another crew folder is not blocked by it. The folder+keeps the meaning of its tab gestures as far as a crew session allows (a crew session has no tab in this machine's strip, and main's own crew rows open their window whatever the modifier): Cmd/Ctrl-click or middle-click keeps the person where they are, creating the chat on the crew without opening it and saying Started a chat on . It's listed under in the sidebar.; Cmd/Ctrl-Shift-click and a plain click open its crew window.offlinesays so in the warn tone (a state, not a failure, so no Ask the agent), starts nothing, and offers Start this chat on Local instead under the sidebar notice; the phone's session menu offers New chat in {folder} on Local, and its notice names that item. A crew that is no longer registered is called that, not offline, in the notice and in Folder settings. With a crew set, Folder settings says the folder's agent applies to chats started on Local (a crew applies its own default agent). The folder keeps its crew. Preview off means Local.default_agent, a subfolder does not inherit its parent's crew. An empty value has to stay choosable as Local on a subfolder of a pinned folder, and one empty string cannot mean both "inherit" and "Local".instances.warm), the same authority the New chat on crew menu uses.en-XA);remote-crew.md, the feature map and the dashboard spec updated.Backwards compatibility
Compatible: the field is optional and absent/
""reads as Local; no existing key, route, validator or type is rejected, renamed or removed, and a gateway or browser without the field behaves as before.Removes nothing:
createRemoteChatMutationkeeps its behaviour (same create, now infolderCrew.ts), andcreateChatInFolderonly branches before its unchanged local path when the preview is on and the folder names a crew.Tests
test/test_dashboard_chat_folders.py: create accepts and trimsdefault_crew; absent means""; non-strings read as Local; the length cap; PATCH sets, clears (""/null) and, when omitted, leaves it alone.test/test_chat_folder_cleanup.py: a folder withdefault_crewis kept.website/src/test/folderDefaultCrew.test.ts: the route decision (local, crew, offline, preview off, unknown crew, no instances slice).website/src/test/FolderConfigModal.test.tsx: picker hidden without crew choices (preview off), options with online state, create/edit submit andtouched, offline warning, orphan crew round-trip, a stored crew untouched by an unrelated edit.website/src/test/ChatSidebar.folderDefaultCrew.test.tsx: the folder+on a connected crew (nothing created locally), offline notice with no create, Local for one chat then asked again next click, preview off, no crew, failed crew create shown under the folder, the settings picker PATCHing onlydefault_crew.website/src/test/ChatPage.mobileNewSessionHereCrew.test.tsx: the phone's New chat in {folder}: connected, offline (warn-tone status, not the error slot), the Local item offered only while the crew is offline and starting a local chat in the folder, preview off.test/test_folder_default_crew_principal_gate.py: an app, a crew member and an internal-auth caller are refused a non-emptydefault_crewon create and PATCH, the refused PATCH writes nothing, an app may still clear it on its own folder, and the person may set it.app="", a subject other than the owner's) is refused a non-emptydefault_crewon create and PATCH with 403default_crew_forbiddenand writes nothing, and may still clear it; the gate now callsis_owner_dashboard_request. Dropping that call turns the test red.paneLayout.flyoutNewLeavesSplit.test.tsx(main's, fix(sidebar): leave Split View on a plain New chat (#21935) #21959) now renders the hook inside a QueryClient, which the folder router reads; it failed on the previous head too.Review round r2 on main 6fd7c1f (head c48ca18): per-folder crew-create guard (Opus), the progress and background lines, the not-registered wording, the phone's Local item and notice, and the agent hint; 239 frontend tests in the 8 affected files plus 5 backend,
tsc, ESLint, the i18n gates and style suites against 6fd7c1f, the line cap and the docs, comment-history and feature-map gates pass, and reverting each of the seven changes turns its test red. The capture script now takes 20 frames, checking each. Earlier: rebased onto main 453cc4b (head 2560276; review fixes since at cac1ffb; two hi/bn strings moved to the informal imperative for main's register gate). #22036 splitchat_folders.pyinto owners, so thedefault_crewfield moved with the code:create_folder_recordinchat_folders_records.py, the create and update routes inchat_folders_routes.py; theChatFoldertype is now inwebsite/src/types/index.chat.ts. Inchat-sidebar/create.tsmain had addedonSelectSlot(#21935) andNewTabMode: both hooks keep them,FolderChatOpts.inNewTabis now aNewTabMode, anduseSessionCreatekeeps main'suseStoreread, which #21935 now needs beside the crew create. Behaviour unchanged. Re-run:test_dashboard_chat_folders.py,test_chat_folder_cleanup.pyand thetest_chat_folders*files (374 passed), mypy and flake8; frontend: the PR's 4 test files plus everyChatSidebar*andFolderConfigModal*suite (129 files, 1514 tests),tsc -p tsconfig.app.json, ESLint, the i18n check, docs-lint, the feature-map gate and the line cap.Manual verification
The captures below are shot from the built SPA by the committed
website/scripts/capture-21546-folder-default-crew.mjs, with every/api/**call stubbed and the Chat on a crew preview on. The script fails unless each frame's claim is true in the DOM: the hint sits inside the Folder settings frame, an online crew raises no warning and an offline one does in the warn tone, a removed crew stays listed as not registered, the offline notice names the crew, is a warn-tone status and starts no chat (sidebar and phone), the phone menu offers Local, and a refused crew create names both versions in the error style. Not verified against a live crew: a pod would not start on this host, and a chat opening ON the crew needs a reachable peer on the same build, so that path is pinned inChatSidebar.folderDefaultCrew.test.tsxinstead.Screenshots / video
Sixteen committed captures in
temp-screenshots/21546-folder-default-crew/, all shot at this head.Folder settings, folder pinned to an online crew: the picker and the hint under it (dark, light):
The picker open: Local, then each registered crew with its state (dark, light):
Folder settings, folder pinned to an offline crew: the warning shows before saving (dark, light):
A folder pinned to a removed crew: it stays listed as "(not registered)" (dark, light):
Sidebar New chat, crew offline: warn-tone notice, ✕ on its row, Local right under it (dark, light):
Sidebar New chat, crew create refused (version mismatch): the error under the folder (dark, light):
Sidebar New chat on a connected crew, while the create runs: the info-tone progress line under the folder (dark, light):
Sidebar Cmd/Ctrl-click on the folder +: created on the crew, no window opened, and the folder says where it went (dark, light):
Phone session menu, crew offline: New chat in Ledger on Local under New chat in Ledger (dark, light):
Phone New chat in Ledger pressed, crew offline: the warn-tone notice names the Local item, nothing started (dark, light):
Follow-up (r121 notes): the Local action now sits inside the offline and not-registered notice, in the sidebar and on the phone.
StatusNoticetakes an optionalactionit draws under the message, inside the box. The phone notice reuses the sidebar sentences and carries "New chat in {folder} on Local" itself, so the two_phonekeys are gone from all 12 catalogs. The menu item stays for a person who reopens the menu.not-registered-notice-*.pngshows the sidebar notice for a removed crew. On the backend,refuse_principal_default_crewand_refuse_principal_steering_dirsnow share onerefuse_person_only_field(same audit, same 403 shape), so the two person-only fields cannot drift apart. Each keeps its own decision and its exact message and code.Related Issues
Closes #21546
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.