Skip to content

feat(crew): edit crewmates on the Customize tab with the shared editor - #21748

Merged
dodgeblaster merged 1 commit into
mainfrom
feat/settings-mate-editor
Oct 20, 2026
Merged

dodgeblaster merged 1 commit into
mainfrom
feat/settings-mate-editor

Conversation

@dodgeblaster

@dodgeblaster dodgeblaster commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

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. RFC rfc-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

  • No new editing surface: Built From stays read-only and agent config stays on the Custom agents tab.
  • No backend change: the capability, inheritance and trigger routes are untouched.
  • Not retiring triggers in the backend; refactor: retire crew triggers, session_color, route_crew, select_crew #19274 owns that.
  • No redesign of the new editor's sections beyond what this tab needs (guide markers, accessible name).

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.

Area Change
KiroCrewAgentsPage.tsx Keeps the roster, the create dialog and the deep links (?crew=, &avatar=1, &pane=capabilities now lands on Approvals); editing mounts CrewEditorModal driven by useCrewEditor, behind the same fresh-roster check as the Crewmates page
Classic sheet CrewCapabilitiesPane, AgentTemplateDetail, CrewOverviewPane, CrewEditorRail, KiroCrewAgentsPagePanes.tsx, KiroCrewAgentsPageDiscard.tsx and their tests are deleted, with the 151 i18n keys only they used
Guide (uiLocations/, guide/guidePredicates.ts) The Model, Edit avatar, Danger zone and Delete markers move onto the new editor through CrewEditorNextRail; the Chat, Manage memory and Memory-section markers are dropped; ui-index.generated.json is regenerated
Shared bits CrewEditorChunkLoading.tsx is the lazy-load fallback both hosts use; the editor's accessible name reads "Edit crewmate "
Page exits (KiroCrewAgentsPage.tsx) While the editor holds unsaved work, leaving the route refuses and raises the editor's own discard confirm, browser Back is armed through the published navigation stake, and a reload gets the browser prompt; an in-flight write refuses the leave outright. Same stakes useMembersPageCrewEditor folds in; the editor's own in-app links (Webhooks → Open webhooks, Memory → open page) go through the same guard via useGuardedLeave() passed as leave, as MembersPage does
Chat refusal (website/src/pages/chat/ErrorCard.tsx, turnRecovery.ts) A parent_identity_changed row (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 like foreign_private_copy; capabilities_parent_changed is reworded in every locale
Memory status (website/src/components/crew/CrewEditorNextDialog.tsx) The retired Workspace · Memory pane was the only place that said which memory a crewmate uses. The editor's Memory section now opens with that line (V2 own memory, kept V1, or Global V1 for the default), and for a broken binding (unavailable or another member's store) shows only the kirocrew doctor diagnostic 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 locale
E2E (website/playwright/capabilities.spec.ts, website/playwright/member-memory.spec.ts) Drive the shared editor: next-rail-danger / next-confirm-delete-crew, the dialog by its Edit 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 page
Capability row editor (website/src/components/crew/CapabilityRowEditor.tsx, CapabilityTransportForm.tsx, capabilityLabels.ts, capabilityTransport.ts; website/src/api/crewCapabilities.ts) Only the retired Capabilities pane mounted these, so they are deleted, with crewCapabilitiesApi.detach (the Stop following parent call) and the 54 catalog keys only they used
Ratchet website/scripts/restyle-baseline.json drops the 3 entries for the deleted files
Docs RFC §10 marks the fold-in landed; crew-mode.md, learn-cron-dashboard.md, mcp.md, the feature map and agents.md describe the one editor and note which inheritance and private-copy UI no longer exists

Backwards 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_changed fix link -- chat -- &pane=capabilities opens the Approvals section, whose empty-draft Review and Save restamps the file (KiroCrewAgentsPage.capabilities.test.tsx)
Reader: docs/system-specs/modules/crew-mode.md Owner-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 retired
Reader: website/src/pages/chat/ErrorCard.tsx parent_identity_changed row -- 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 them
Reader: 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.json agents.chat, agents.manage-memory, agents.section-place -- find_ui / guide -- removed with the controls they named; test_find_ui_browse.py lists "Crewmate memory" as a coverage gap and maps "Chat with crewmate" to the Crewmates page roster
Reader: website/src/i18n/locales/*.json 205 keys -- dashboard -- every key was referenced only by the deleted modules (grep across website/, src/, test/, e2e/, scripts/)

Tests

  • CrewRoster.test.tsx, KiroCrewAgentsPage.{discardGuard,schedDraftGuard,reasoningEffort,capabilities,createRosterRefresh}.test.tsx drive 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.tsx adds the page-exit guard: a clean editor leaves freely; a dirty one refuses the route leave, raises the discard confirm and arms beforeunload; after Discard the repeated leave goes through. The lazy-editor waits carry an explicit EDITOR_OPEN_TIMEOUT_MS.
  • KiroCrewAgentsPage.discardGuard.test.tsx also clicks Open webhooks inside a dirty editor and checks the discard confirm appears, the route stays and the draft survives (fails without the leave wiring).
  • ErrorCard.test.tsx and transcriptRenderers.test.tsx pin the parent_identity_changed row's new copy and its route to the crewmate's editor.
  • CrewEditorNextDialog.test.tsx pins 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.ts drives the capabilities client's get, preview and save through the real request builders (the editor suites mock the module).
  • CrewEditorNextRail.test.tsx locks the rail's guide markers and locking; members.locations.test.ts / uiIndex.test.ts pin the moved markers.
  • Backend test_find_ui_members.py, test_find_ui_browse.py, test_guide_ui_find.py, test_guide_ui_show.py updated to the new guide paths.
  • Local: full frontend vitest (3,088 files), tsc, eslint, i18n:check, docs-lint, build, and 43 backend find_ui/guide/doc test files (2,375 passed; the 1 failure, test_mcp_slim_entry, comes from the borrowed test venv loading aiohttp, not this diff).

Manual verification

Ran website/scripts/verify-crews-dialog-select.mjs against 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):

Crewmates tab opens the shared editor

Related Issues

Closes #21743

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 added the readiness: checking Automated validation is still running label Oct 18, 2026
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — 🟡 CONCERNS

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

  • Item 3 — inherited: these features are removed only because "feat(crew): make the New editor the only crewmate editing experience #19257 decided belong to the agent", which is a PR and not a recorded decision. The base RFC §10 says "The detail page stays the full 'HR file' surface", and this PR makes the detail page the smaller editor instead. Whether §10 covers removing these features is a judgement call, so this stays at CONCERNS rather than (c).
    Clears when: a maintainer records /ai-review override first-principles aaf7f7d4f469e87f0a3a8cf6df06cf160107689a: <decision>, or a non-draft RFC covering these removals is on the base (then push or rebase).
  • Item 4 — rides along: the error row now tells the user to "pick a different agent under Built from" because the Stop-following escape is removed (item 3). Its justification depends on item 3.

What this change ships

Inventory (8 items) — 5 justified

Intent: one crewmate editor wherever a crewmate is opened. This is an ADDITION (a fold-in that also removes features).

  1. The Customize → Crewmates tab opens the same editor as the Crewmates page — justified
  2. &pane=capabilities deep links now land on Approvals — justified
  3. Stop following parent, per-member MCP/skill rows, private-copy edit/reset/publish and trigger editing are gone from the dashboard — inherited: no recorded decision covers the removals
  4. The parent_identity_changed row has new copy, and its fix opens Built from — rides along: depends on item 3
  5. The Memory section shows which memory the crewmate uses and a kirocrew doctor line when the binding is broken — justified
  6. Leaving with unsaved edits raises the discard confirm, and browser Back and reload are guarded too — justified
  7. The guide's Chat and Manage memory markers are removed, and Model, Avatar and Delete move to the new rail — undeclared: none
  8. 205 i18n keys, crewCapabilitiesApi.detach and the capability row editor are deleted — justified

[FIRST-PRINCIPLES-REVIEWED] aaf7f7d

Description read

[DESCRIPTION-READ] fe7b3faab6b9ed747be11d8163b3ce805a2fb399dd6afa60253680411970dfdc

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

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings that block the merge.

FINDING — website/capture/capabilities-drift-repair.tsx:22 — this PR deletes CrewCapabilitiesPane.tsx, but the capture page still has import CrewCapabilitiesPane from '../src/components/crew/CrewCapabilitiesPane'. Vite can't resolve the import, so capture/capabilities-drift-repair.html and scripts/capture-capabilities-drift-repair.mjs now fail. tsc and the build miss it because they don't cover capture/ → Fix: delete or rewrite website/capture/capabilities-drift-repair.{tsx,html} and website/scripts/capture-capabilities-drift-repair.mjs in the same PR as the pane.

[OPUS-REVIEWED] aaf7f7d

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

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

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] aaf7f7d

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

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 18, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from 2d5d800 to 52e3e80 Compare October 18, 2026 23:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 18, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from 52e3e80 to 2cf8989 Compare October 19, 2026 17: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 merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 19, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from 2cf8989 to 770db18 Compare October 19, 2026 18:49
@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 19, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from 770db18 to 2f32cb7 Compare October 19, 2026 19:25
@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 19, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from 2f32cb7 to d024de8 Compare October 19, 2026 20:38
@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 19, 2026
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 20, 2026
@dodgeblaster
dodgeblaster force-pushed the feat/settings-mate-editor branch from ecfff12 to aaf7f7d Compare October 20, 2026 17:20
@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 20, 2026
@dodgeblaster

Copy link
Copy Markdown
Contributor Author

/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.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

/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.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@dodgeblaster marked the design AI finding as false positive, not applicable, or explicitly accepted for aaf7f7d4f469e87f0a3a8cf6df06cf160107689a.

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.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@dodgeblaster marked the ux AI finding as false positive, not applicable, or explicitly accepted for aaf7f7d4f469e87f0a3a8cf6df06cf160107689a.

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.

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ human override accepted

@dodgeblaster overrode this lane for aaf7f7d4f469e87f0a3a8cf6df06cf160107689a via /ai-review override (this commit only).

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ human override accepted

@dodgeblaster overrode this lane for aaf7f7d4f469e87f0a3a8cf6df06cf160107689a via /ai-review override (this commit only).

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention labels Oct 20, 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.

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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).
  6. 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.
  7. 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).

@dodgeblaster
dodgeblaster merged commit dea18bc into main Oct 20, 2026
106 of 116 checks passed
@dodgeblaster
dodgeblaster deleted the feat/settings-mate-editor branch October 20, 2026 19:12
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 20, 2026
@abirkel abirkel mentioned this pull request Oct 22, 2026
5 tasks done
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.

Edit crewmates on the Customize tab with the same editor as the Crewmates page

2 participants