Repository navigation
feat(crew): edit crewmates on the Customize tab with the shared editor - #21748
Conversation
First Principles Review (Opus 5.5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The fold-in is covered by RFC §10, but deleting Stop following parent, per-member capability rows, private-copy editing and trigger editing is not. Not justified as shipped
What this change shipsInventory (8 items) — 5 justifiedIntent: one crewmate editor wherever a crewmate is opened. This is an ADDITION (a fold-in that also removes features).
[FIRST-PRINCIPLES-REVIEWED] aaf7f7d Description read[DESCRIPTION-READ] fe7b3faab6b9ed747be11d8163b3ce805a2fb399dd6afa60253680411970dfdc That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Review detailsNo findings that block the merge. FINDING — website/capture/capabilities-drift-repair.tsx:22 — this PR deletes [OPUS-REVIEWED] aaf7f7d 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: |
2d5d800 to
52e3e80
Compare
52e3e80 to
2cf8989
Compare
2cf8989 to
770db18
Compare
770db18 to
2f32cb7
Compare
2f32cb7 to
d024de8
Compare
ecfff12 to
aaf7f7d
Compare
|
/ai-review override design aaf7f7d: The diff is over the 1 MB limit mostly from deleting the retired classic editor and its 205 dead i18n keys across 13 catalogs; the behavioural change is small and reviewed by GPT, Opus and First Principles. |
|
/ai-review override ux aaf7f7d: The diff is over the 1 MB limit mostly from deleting the retired classic editor and its 205 dead i18n keys across 13 catalogs; the Customize tab now opens the same editor the Crewmates page already ships. |
Human judgment recorded@dodgeblaster marked the design AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Human judgment recorded@dodgeblaster marked the ux AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
Design Review (Opus 5.5) — ✅ human override accepted@dodgeblaster overrode this lane for |
UX Review (Opus 5.5) — ✅ human override accepted@dodgeblaster overrode this lane for |
buluoray
left a comment
There was a problem hiding this comment.
Reviewed at aaf7f7d.
Approve. The Customize > Crewmates tab now mounts the shared CrewEditorModal / useCrewEditor editor behind the same fresh-roster check as the Crewmates page, and the page-exit guard, beforeunload and in-editor link guard are wired. Existing crewmate data is preserved: the PUT carries only the binding fields plus avatar, triggers and session_color are seeded from the record and sent back unchanged (useCrewEditor.ts:457-459, 690-700), the server applies only keys present in the body (crew_update.py:401-599), and Approvals saves send only the changed operations.
Verified locally: tsc; vitest on 21 related files (659 tests) plus the MembersPage suites (406 tests); i18n-check, check-i18n-strings and gen-ui-index --check; pytest on the four find_ui / guide files (365 passed). Mutations: making the route-leave guard always allow fails three discardGuard tests; dropping leave from useCrewEditor fails the Open webhooks guard test; dropping the fresh-roster latch fails three reasoningEffort tests. CI on this head: every latest row is success or skipped, PR Readiness passed.
Follow-ups, none blocking:
- The rationale cites #19257 as deciding tools/MCP/skills belong to the Custom agents tab. #19257 said they move to this page (the follow-up PR). After this change no person-facing dashboard surface edits per-crewmate MCP or skill rows, enrollment, Stop following parent, or a private copy (edit, reset, publish, fork). The loss is named in the body and crew-mode.md; worth a product-owner line or a docs/decisions entry so it is on record.
- Reader list misses Session colour: main mounted SessionColorField for an existing crewmate (KiroCrewAgentsPagePanes.tsx:256); at head it is only in NewCrewmateDialog.tsx:986, so the colour can be set at create but not changed. #19240 retires it, but the body should name it.
- Custom agents tab hint read_only_private_copy (en.manual.json:7023, AgentTemplatesTab.tsx:132) still says open the crewmate to edit it; the crewmate Built from section is now read-only, so that path is a dead end.
- POST /api/agents/{name}/capabilities/detach (routes/agents.py:49) now has no caller in the dashboard, CLI or change cards. Retire it or give it a caller.
- website/capture/capabilities-drift-repair.tsx:22 still imports the deleted CrewCapabilitiesPane, so the capture-capabilities-drift-repair script no longer runs (the capture tree is outside tsc and vitest).
- Stale references: comments at eslint.config.js:253, CfgTabCoverage.test.tsx:23 and IssueRadarCrewEditor.test.tsx:71 name the deleted CrewEditorSelect.test.tsx; stub-dashboard-api.mjs:207 names AgentTemplateDetail; src/kiro_crew/docs/agents.md:114 still lists a Template pane PATCH.
- The KiroCrewAgentsPage comment saying the editor saves the WHOLE agent snapshot overstates the payload, and no test names the stale-copy latch directly (it is caught only indirectly by the reasoningEffort suite).
Problem / Motivation
Goal: Editing a crewmate from Customize -> Crewmates opens the same crewmate editor as the Crewmates page, so a crewmate has one editor wherever it is opened.
#19257 moved the Crewmates page onto the new crewmate editor (
CrewEditorNextDialog) but left the Customize -> Crewmates tab (KiroCrewAgentsPage.tsx) on the classic inline sheet to keep that PR small. The two surfaces show different sections and two different approvals UIs, and the classic sheet still offers capability, template-fork and Routing panes the new editor deliberately does not. RFCrfc-crewmates-launch.md§10 records moving this page onto the one editor as the committed follow-up.Why it matters
A person who edits the same crewmate from two places gets two different editors with different rules: the Customize tab still lets them edit tools, MCP servers, skills and triggers on the crewmate, which #19257 decided belong to the agent (Custom agents tab), not the crewmate. Until the surfaces match, every editor change has to be made twice by hand (RFC §10).
Not a goal
What changed (motivation → approach → change)
Clicking a crewmate on the Customize -> Crewmates tab now opens the same editor the Crewmates page opens, with Built From read-only and no Triggers, template or capability panes.
KiroCrewAgentsPage.tsx?crew=,&avatar=1,&pane=capabilitiesnow lands on Approvals); editing mountsCrewEditorModaldriven byuseCrewEditor, behind the same fresh-roster check as the Crewmates pageCrewCapabilitiesPane,AgentTemplateDetail,CrewOverviewPane,CrewEditorRail,KiroCrewAgentsPagePanes.tsx,KiroCrewAgentsPageDiscard.tsxand their tests are deleted, with the 151 i18n keys only they useduiLocations/,guide/guidePredicates.ts)CrewEditorNextRail; the Chat, Manage memory and Memory-section markers are dropped;ui-index.generated.jsonis regeneratedCrewEditorChunkLoading.tsxis the lazy-load fallback both hosts use; the editor's accessible name reads "Edit crewmate "KiroCrewAgentsPage.tsx)useMembersPageCrewEditorfolds in; the editor's own in-app links (Webhooks → Open webhooks, Memory → open page) go through the same guard viauseGuardedLeave()passed asleave, as MembersPage doeswebsite/src/pages/chat/ErrorCard.tsx,turnRecovery.ts)parent_identity_changedrow (from #21914) told the user to press Stop following parent, the retired button. Its copy now says to put the parent back or pick a different agent under Built from, and its fix opens the crewmate's editor likeforeign_private_copy;capabilities_parent_changedis reworded in every localewebsite/src/components/crew/CrewEditorNextDialog.tsx)kirocrew doctordiagnostic instead of editing that store. A binding that breaks while a Memory draft is unsaved keeps those editors mounted but read-only, so the typed text is not discarded. Three keys the retired field used come back in every localewebsite/playwright/capabilities.spec.ts,website/playwright/member-memory.spec.ts)next-rail-danger/next-confirm-delete-crew, the dialog by itsEdit crewmate <name>name, the Memory rail section and its status line; the retired Manage memory hop becomes a direct visit to the member's memory pagewebsite/src/components/crew/CapabilityRowEditor.tsx,CapabilityTransportForm.tsx,capabilityLabels.ts,capabilityTransport.ts;website/src/api/crewCapabilities.ts)crewCapabilitiesApi.detach(the Stop following parent call) and the 54 catalog keys only they usedwebsite/scripts/restyle-baseline.jsondrops the 3 entries for the deleted filescrew-mode.md,learn-cron-dashboard.md,mcp.md, the feature map andagents.mddescribe the one editor and note which inheritance and private-copy UI no longer existsBackwards compatibility
Compatible: no route, config key or stored record changes; every deep link into the tab still opens the crewmate's editor.
Reader:
website/src/pages/chat/page/turnRecovery.ts:materialization_changedfix link -- chat --&pane=capabilitiesopens the Approvals section, whose empty-draft Review and Save restamps the file (KiroCrewAgentsPage.capabilities.test.tsx)Reader:
docs/system-specs/modules/crew-mode.mdOwner-reviewed capability inheritance -- crew page -- the routes are unchanged; a Dashboard surface note says only Approvals writes them now and the Stop-following / per-member row UI is retiredReader:
website/src/pages/chat/ErrorCard.tsxparent_identity_changedrow -- chat -- the fix button opens the crewmate's editor (Built from) instead of the Capabilities pane, and the copy no longer names Stop following parent (ErrorCard.test.tsx,transcriptRenderers.test.tsx)Reader: crewmate
triggers-- crew page -- no dashboard surface edits them; the field and routing keep working from config, and #19274 retires themReader: a crewmate's private copy of an agent template -- crew page -- the copy is used as before; editing, reset and publish from the dashboard are gone, recorded in the feature map
Reader:
src/kiro_crew/docs/ui-index.generated.jsonagents.chat,agents.manage-memory,agents.section-place-- find_ui / guide -- removed with the controls they named;test_find_ui_browse.pylists "Crewmate memory" as a coverage gap and maps "Chat with crewmate" to the Crewmates page rosterReader:
website/src/i18n/locales/*.json205 keys -- dashboard -- every key was referenced only by the deleted modules (grep acrosswebsite/,src/,test/,e2e/,scripts/)Tests
CrewRoster.test.tsx,KiroCrewAgentsPage.{discardGuard,schedDraftGuard,reasoningEffort,capabilities,createRosterRefresh}.test.tsxdrive the new editor from this tab: stale and in-flight writes, avatar round-trips, discard and schedule-draft guards, reasoning effort, the Approvals deep link.KiroCrewAgentsPage.discardGuard.test.tsxadds the page-exit guard: a clean editor leaves freely; a dirty one refuses the route leave, raises the discard confirm and armsbeforeunload; after Discard the repeated leave goes through. The lazy-editor waits carry an explicitEDITOR_OPEN_TIMEOUT_MS.KiroCrewAgentsPage.discardGuard.test.tsxalso clicks Open webhooks inside a dirty editor and checks the discard confirm appears, the route stays and the draft survives (fails without theleavewiring).ErrorCard.test.tsxandtranscriptRenderers.test.tsxpin theparent_identity_changedrow's new copy and its route to the crewmate's editor.CrewEditorNextDialog.test.tsxpins the Memory status line for a V2 store and the diagnostic-only view for a store another member owns. It also pins that an unsaved Profile draft survives, read-only, when a config refetch breaks the binding mid-edit.crewCapabilitiesApi.test.tsdrives the capabilities client's get, preview and save through the real request builders (the editor suites mock the module).CrewEditorNextRail.test.tsxlocks the rail's guide markers and locking;members.locations.test.ts/uiIndex.test.tspin the moved markers.test_find_ui_members.py,test_find_ui_browse.py,test_guide_ui_find.py,test_guide_ui_show.pyupdated to the new guide paths.test_mcp_slim_entry, comes from the borrowed test venv loadingaiohttp, not this diff).Manual verification
Ran
website/scripts/verify-crews-dialog-select.mjsagainst the built dist: it opens a crewmate from this tab, commits a Radix select inside the editor, scopes Escape to a nested dialog and closes through the discard confirm, with 0 console errors. No live gateway: this host's python3.12 cannot build a venv, so no pod could start.Screenshots / video
Customize -> Crewmates, editing
oncall(stubbed API, built dist):Related Issues
Closes #21743
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)