Repository navigation
fix(chat): tell a same-name crewmate and custom agent apart by memory - #21333
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check one case: a default-store crewmate paired with a same-name template shows "Shared memory" on both rows, so the pair still looks identical in the picker. [DESIGN-REVIEWED] aefec9e Description read[DESCRIPTION-READ] bd2ced267e4af2b3b756df40316bd8edd785a7f974c8c1dbcf44ddfe84f39016 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 |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The new "Shared memory" tag doesn't say what the memory is shared with. That is the one distinction this PR adds, and the blind reader couldn't read it. Watch
Suggestions
[UX-REVIEWED] aefec9e Description read[DESCRIPTION-READ] 648d023049b637121d6f2f19c2ad90a38a1ecaa67ebf0e2f0884ccbae0e0fd20 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing to check. What this change shipsInventory (7 items) — 7 justifiedIntent: when a crewmate and a custom agent share a name, a user can see which memory a pick or a session uses. This is a FIX (closes #19472).
[FIRST-PRINCIPLES-REVIEWED] aefec9e Description read[DESCRIPTION-READ] 05295b17d6035575090e82249243203811d74038fdea8438cde6c535c761bebc That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
d9ec225 to
ed71cce
Compare
|
|
|
|
|
|
Design Review (PASS) punchline on d9ec225, checked: a kind-less slot does resolve to the crewmate. The backend's name-first resolution is documented as "a crewmate wins, with its own memory" in |
When the agent picker lists a crewmate and a custom agent of one name, each row's second line says "Own memory" or "Shared memory". The composer agent chip (main and split pane), the session-list label and the "default for new sessions" footer say which one they mean, e.g. "reviewer · own memory". Names without a same-name pair are unchanged. The kind rule (isCrewmateChat) moves next to the memory helpers so the footer and the labels resolve a session's kind the same way. The Default badge and the footer already agree since #18342; a test pins that for a same-name pair. Closes #19472
ed71cce to
aefec9e
Compare
|
|
|
|
|
|
PASS punchlines on ed71cce, checked:
Head is now aefec9e: the new sidebar test pins its clock with |
|
|
|
|
Design PASS punchline on aefec9e (a default-store crewmate next to a same-name template shows "Shared memory" on both rows): intended, and rare. With |
chenmingwei23
left a comment
There was a problem hiding this comment.
Approved via bulk merge run: no failing checks on the current revision.
Problem / Motivation
Goal: When a crewmate and a custom agent share a name, every place that names the agent says which one it is: own memory or shared memory.
Since #19304 the chat agent picker can list a crewmate with its own memory next to a custom agent (template) of the same name. Both rows read the same name. The composer agent chip and the session-list label also show only the name, so a user cannot tell which binding a session runs on.
Why it matters
The two picks look the same but save to different memory. A user who picks the wrong row teaches the shared memory what they meant for the crewmate, or the reverse, and nothing on screen tells them.
Not a goal
What changed (motivation → approach → change)
Two rows of one name differ only in the memory they bind, so the fix names that memory, and only where a same-name pair exists.
reviewer · own memory(text and aria-label)reviewer · shared memoryreviewer · shared memory is the default…One helper module,
website/src/lib/agentMemorySource.ts, decides it. A crewmate whose store is notdefaultreads "own"; a template or a default-store crewmate reads "shared". An agent-less session is the default template; otherwiseisCrewmateChatpicks the kind, the same rule the footer already used (recorded kind first, a kind-less slot as the crewmate, as the backend's name-first resolution answers).isCrewmateChatmoves into that module andAgentDropdownList.tsxre-exports it, so its importers keep their path. The label pieces go throughwithMemorySourceinwebsite/src/utils/agentLabel.ts. The picker row tag lives inAgentDropdownList.tsx; the chip inchat-input/ContextShelf.tsx, fed byComposerDockViewand the split pane (ChatPane.tsx,ChatPanePickerMenus.tsx). The rows come fromhooks/useAgents.ts(newdisplayChoices, the picker rows as last loaded), threaded throughsessionRosters,SessionsSidebarChrome,ChatSidebarand thechat-sidebarrow shell toSessionRow; peer rows and rows running on another crew are not marked, since this catalog is local. The Default badge and the footer already point at the template row since #18342; a test pins that for a same-name pair. Four new keys ship in all 12 catalogs, withen-XAregenerated and translator context inen.context.json.Backwards compatibility
Compatible: display-only additions; no wire field, route or stored value changes, and every name without a same-name pair renders as before.
Removes nothing: the change only adds text to existing labels.
Tests
website/src/test/agentMemorySource.test.ts: own vs shared from the store id, tag only for a same-name pair, session kind resolution (recorded, kind-less, agent-less), label text.website/src/test/AgentDropdownList.memoryTag.test.tsx: tags on both rows of a pair and on no other row, tag is the second line, Default badge only on the template row, footer only from a template chat and naming which reviewer.website/src/test/ChatInput.agentChipMemory.test.tsx: chip text and aria-label carry the mark; unset leaves both unchanged.website/src/test/ChatSidebar.memorySourceLabel.test.tsx: session rows marked per kind, kind-less as crewmate, unpaired names and hosts without rows unmarked; the clock is pinned withvi.setSystemTime.website/src/pages/chat-sidebar/rows.test.tsandwebsite/src/components/ChatPane.pickerMenus.test.tsx: fixtures gainmemoryRows/agentChoices.Run locally: unit shard 2/4 (760 files), every test file importing the changed picker, roster or ChatPage modules (217 files), the four new files plus AgentDropdownList, ChatInput agent chip, ChatSidebar default marker, rows, useAgents, ChatSidebar.rowMemo, ChatPane, ChatPage drawer frame budget;
I18N_BASE_REF=origin/main vitest run src/i18n(50 files);tsc -p tsconfig.app.json; eslint on changed files;lint:i18n,lint:theme-colors,lint:phantom-classes,lint:restyle-ratchet;pytest -n0 test/test_flake_pattern_ratchet.py.Manual verification
Built the SPA (
npm run build) and captured it with scripted Playwright on a 127.0.0.1 port, every/apicall stubbed with a catalog holding crewmatereviewer(own store), custom agentreviewer, andwriter. A fresh-context new-user review read the frames: it could tell the two rows apart and which one each chat uses, and flagged that the default footer did not say which reviewer; the footer now does.Screenshots / video
Picker on the crewmate chat (crewmate ticked, no default footer) and on the custom-agent chat (badge, tick and footer on the same row):
Custom-agent chat scrolled down, with the crewmate row and its "Own memory" line in view:
Session list and composer chip:
Related Issues
Closes #19472
Pattern harvest
Not generalizable: a missing label for one product shape (same-name crewmate and template), not a recurring code defect.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)