Skip to content

fix(chat): tell a same-name crewmate and custom agent apart by memory - #21333

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/19472-memory-source-row-tags
Oct 17, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/19472-memory-source-row-tags

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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.

Surface Same-name pair Any other name
Picker row, second line "Own memory" / "Shared memory" no tag
Composer agent chip (main and split pane) reviewer · own memory (text and aria-label) unchanged
Session-list label reviewer · shared memory unchanged
"Default for new sessions" footer reviewer · shared memory is the default… unchanged

One helper module, website/src/lib/agentMemorySource.ts, decides it. A crewmate whose store is not default reads "own"; a template or a default-store crewmate reads "shared". An agent-less session is the default template; otherwise isCrewmateChat picks 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). isCrewmateChat moves into that module and AgentDropdownList.tsx re-exports it, so its importers keep their path. The label pieces go through withMemorySource in website/src/utils/agentLabel.ts. The picker row tag lives in AgentDropdownList.tsx; the chip in chat-input/ContextShelf.tsx, fed by ComposerDockView and the split pane (ChatPane.tsx, ChatPanePickerMenus.tsx). The rows come from hooks/useAgents.ts (new displayChoices, the picker rows as last loaded), threaded through sessionRosters, SessionsSidebarChrome, ChatSidebar and the chat-sidebar row shell to SessionRow; 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, with en-XA regenerated and translator context in en.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 with vi.setSystemTime.
  • website/src/pages/chat-sidebar/rows.test.ts and website/src/components/ChatPane.pickerMenus.test.tsx: fixtures gain memoryRows / 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 /api call stubbed with a catalog holding crewmate reviewer (own store), custom agent reviewer, and writer. 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):

picker, crewmate chat
picker, custom-agent chat

Custom-agent chat scrolled down, with the crewmate row and its "Own memory" line in view:

picker, custom-agent chat, scrolled

Session list and composer chip:

session list
chip, crewmate
chip, custom agent

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

  • 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

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

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 .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 16, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🟡 CONCERNS

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

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

  • "Shared memory" / "Own memory" name the difference but not the effect. The picker tag (shared_memory, own_memory) is the only text that separates the two "reviewer" rows. The blind reader said: "I have no idea what the memory is shared with" and "I still don't know what changes for me when I pick one or the other". They would pick a row "but I'd hesitate". So a user choosing between the two still can't predict where the conversation will be remembered, which is the risk this PR exists to fix. Severity: moderate. It only shows up for same-name pairs, but it shows up every time you pick from one, and that is the PR's main path. Smallest fix: name the owner in the tag. Use "Shared with all custom agents" or "Default memory" instead of "Shared memory", and "This crewmate's memory" instead of "Own memory".
  • The footer reads like a setting you could change. reviewer · shared memory is the default for new sessions is italic with a tick next to it. The reader said they "wouldn't click it, because it looks like it might change a setting" and couldn't tell whether it's a button. The " · shared memory" suffix makes the line longer and more mechanical, which adds to the doubt. Severity: low. It appears once per picker open and doesn't stop the task.

Suggestions

  • Use one casing for the tag everywhere: the picker shows "Own memory" and the chip and session list show "own memory". The reader noticed the difference. Either reuse the same phrase or keep both lowercase after the ·.

[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 .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 16, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

Nothing to check.

What this change ships

Inventory (7 items) — 7 justified

Intent: 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).

  1. Picker rows of a same-name pair get a second line, "Own memory" or "Shared memory" — justified
  2. Composer agent chip text and aria-label, main and split pane, add the memory for a same-name pair — justified
  3. Labels on local session-list rows add the memory for a same-name pair; peer and other-crew rows stay unmarked — justified
  4. "Default for new sessions" footer and set-default offer name "· shared memory" for a same-name pair — justified
  5. Four new catalog keys in all 12 locales, plus translator context — justified
  6. useAgents returns displayChoices (picker rows as last loaded), read by the session list — justified
  7. isCrewmateChat moves to lib/agentMemorySource, re-exported from its old path — justified

[FIRST-PRINCIPLES-REVIEWED] aefec9e

Description read

[DESCRIPTION-READ] 05295b17d6035575090e82249243203811d74038fdea8438cde6c535c761bebc

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] aefec9e

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

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

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] aefec9e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt aefec9ebe841dd06e391ddd70cc6200b4829e634: <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 16, 2026
@iamwhatever
iamwhatever force-pushed the fix/19472-memory-source-row-tags branch from d9ec225 to ed71cce Compare October 16, 2026 18:55
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 7: sessionMemoryTag duplicates isCrewmateChat span=9c4af9121ae3

fixed: fixed in ed71cce: after the agent-less branch, sessionMemoryTag now calls isCrewmateChat(kind, name, rows) for the kind.
isCrewmateChat moved into website/src/lib/agentMemorySource.ts (no lib -> components import cycle); AgentDropdownList.tsx re-exports it, so its importers keep their path.
One rule now serves the footer, the chip and the session label.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 8: empty-roster fallbacks with no production path span=b850abf90041

fixed: fixed in part in ed71cce: removed NO_CHOICES and its ?? in sessionRosters.ts; useAgents always returns displayChoices.
rebutted in part: ChatSidebar keeps rowChoices optional with the stable NO_MEMORY_ROWS default, the same contract as its existing optional rowAgents.
Evidence: 114 of 115 test files that render pass no rowChoices; without the default SessionRow would iterate undefined. A fresh [] instead of the constant broke ChatPage.drawerFrameBudget (63 renders vs 2).

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Memory tag does not say what the difference does span=c75d81f87a6f

rebutted: rebutted (disproportional for this fix): "Own memory" / "Shared memory" is the copy #19472 and its design-lane comment specify, placed as the row second line.
What a crewmate is lives on the Crewmates page (pages.kiroCrewAgentsPage: "A crewmate is a standing teammate with its own files and its own memory").
A hover-only title is unreachable on touch and adds two keys in 12 catalogs; the visible tag already separates the rows, which is the goal.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Chip uses the same icon for both kinds span=24275e04118d

rebutted: rebutted (out of goal): the goal is to name which one is in use; the chip text and its aria-label carry "own memory" / "shared memory".
Swapping the chip or session-row icon by kind is a new visual on two surfaces, beyond this fix; the text mark reaches screen readers, an icon would not.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Rename "Own memory" to "Own memory (crewmate only)" span=9750788ae220

rebutted: rebutted: the row already sits under the Crewmates heading and wears the crewmate avatar, so "(crewmate only)" repeats what the row shows.
It also lengthens the tag in all 12 catalogs and in the truncated chip and session label, where the suffix is the part that matters.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

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 src/kiro_crew/docs/session-control.md (the agent_kind row) and src/kiro_crew/mcp_dashboard.py (the agent_kind schema: "a member wins"). session_agent_selection.py passes no selection_kind to the resolver when the slot has neither an execution record nor a kind. Since ed71cce, sessionMemoryTag takes that kind from isCrewmateChat, the same rule the picker footer uses, so the two cannot drift. Test: agentMemorySource.test.ts ("reads a kind-less slot as the crewmate").

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 16, 2026
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
@iamwhatever
iamwhatever force-pushed the fix/19472-memory-source-row-tags branch from ed71cce to aefec9e Compare October 16, 2026 19:36
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The tag does not explain itself span=80e3acc7f01c

rebutted: rebutted: same class as span=c75d81f87a6f on d9ec225 (answered there).
"Own memory" / "Shared memory" is the copy #19472 and its design-lane comment specify; the goal is to tell the rows apart, which the reader confirmed.
What a crewmate and its memory are is explained on the Crewmates page; restating it in a picker row would widen this fix.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Set-default footer variant has no screenshot span=4b8ca059d4bb

rebutted: rebutted: the variant only adds the same mark to the existing set-default button text; layout and control are unchanged.
Pinned by AgentDropdownList.memoryTag.test.tsx "marks the set-default offer the same way" (exact text "Set reviewer · shared memory as the default for new sessions").

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Footer tick reads as a button span=81104bf1c420

rebutted: rebutted (out of goal): the footer tick and its role="status" caption predate this PR (#4526); this PR changes only the agent name inside the caption text.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Rename "Shared memory" to "Shared default memory" span=8877c3380f32

rebutted: rebutted: own vs shared is the one contrast the pair needs, and the issue specifies those words; "default" already means "default for new sessions" in the same pop-up (badge and footer), so adding it here would overload it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Crewmate row cut off under the footer in shot-02 span=32b7e8740f6e

fixed: fixed in the PR description for aefec9e: added a frame of the custom-agent chat scrolled down, with the crewmate row and its "Own memory" line in view.
The list scroll is host-owned (max-h 280px) and unchanged; the row is reachable by scrolling, as before.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

PASS punchlines on ed71cce, checked:

  • Design (does a kind-less slot resolve to the crewmate?): yes, answered with evidence in the comment above on d9ec225. session-control.md documents name-first resolution as "a crewmate wins", and sessionMemoryTag reads the kind through isCrewmateChat, the picker footer's rule.
  • First Principles (do the chip and the sidebar read the same rows?): yes. effectiveAgents is catalogChoices, which is useAgents().choices = withoutCoveredCrewmates(shown) (or shown with the config key on). displayChoices applies the same filter to shownDisplay, the last loaded copy of the same catalog. Both are unfolded picker rows; the only difference is that displayChoices is not emptied during a scope switch, so the sidebar does not flicker.

Head is now aefec9e: the new sidebar test pins its clock with vi.setSystemTime (flake ratchet J3, Backend Tests shard 2), rebased on main.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • "Shared memory" / "Own memory" name the difference but not the effect span=eeb968b9d5a3

rebutted: rebutted: third round of the same wording ask (c75d81f87a6f on d9ec225, 80e3acc7f01c on ed71cce, both answered); no new evidence.
The copy is the one #19472 and its design-lane comment specify. Whether the picker should explain memory in more words is a product-copy call for the maintainer, not a defect in this fix.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The footer reads like a setting you could change span=fc09e92e30ad

rebutted: rebutted (out of goal): the footer is a role="status" caption with a decorative tick, unchanged since #4526; this PR only puts the memory mark inside its agent name.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • One casing for the tag everywhere span=6aac6d5ff618

rebutted: rebutted: the row tag is a standalone line, so it takes sentence case ("Own memory"); after the "·" the mark follows the existing inline marker style, which is lowercase ("kirocrew · default", agentOrDefaultLabel).

@iamwhatever

Copy link
Copy Markdown
Contributor Author

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 dashboard.crewmates_in_agent_picker off (the default), withoutCoveredCrewmates withholds a default-store crewmate whose kiro_agent is a listed template, so the common case lists one row. Both rows show only with the config key on, or when the crewmate runs a different template under that name. In that case both picks really do bind the shared store, and the tag says so rather than inventing a difference. The crewmate row still sits under the Crewmates heading with its avatar. Pinned by agentMemorySource.test.ts ("says what the pick binds, even when both rows share memory").

@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 Oct 16, 2026

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

Approved via bulk merge run: no failing checks on the current revision.

@chenmingwei23
chenmingwei23 merged commit 7922287 into main Oct 17, 2026
101 of 102 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/19472-memory-source-row-tags branch October 17, 2026 00:32
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 17, 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.

Agent picker: tell same-name crewmate and template rows apart

2 participants