Repository navigation
fix(members): let a new crewmate start from a deleted one's memory - #22947
mbriones98 wants to merge 3 commits into
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reuses a kept store's recorded identity under the existing lock and compare-and-set path, and leaves every live-owner guard as it was. Notes
[DESIGN-REVIEWED] ab17a57 Description read[DESCRIPTION-READ] cbf2c4c7b6ed55a992ee0f26e5d5272b11cd18178ada34e301562629d9bc0d0f 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) — 🔴 BLOCKUX-level review of UX-Verdict: BLOCK The blind reader would not dare pick the kept memory, the PR's main control: the hint "nothing is copied" and the label "Kept memory of Reviewer" don't say what happens to that memory. No screenshot shows the refusal or the failed-load notice. BlockersKept-memory choice reads as risky Evidence gaps
Notes
[UX-REVIEWED] ab17a57 Description read[DESCRIPTION-READ] e9b517473a117842a8797d796d3ca8c18dc3d7e4c7fcc3f242b8e326c49757e7 That sha256 names everything this verdict read: the PR description, plus the 7 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 blocks. One part of the change is not mentioned in the description, and one new check runs on every create, not just on adopts. Notes
What this change shipsInventory (9 items) — 7 justifiedIntent: let a person rebuild a deleted crewmate by starting a new one from the memory it left behind, and make the delete warning say this is possible. This is a FIX (#22487).
[FIRST-PRINCIPLES-REVIEWED] ab17a57 Description read[DESCRIPTION-READ] 3f889741efc3fb0a159868700d8275313510d906bcd4d7a3b4c567331f08bf86 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review — 🔴 changes requested (blocking)GPT 6.1 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- src/kiro_crew/dashboard/handlers/members_thread.py:134 -- Same-name adoption retains the deleted mate’s Trust grant
BLOCKING -- src/kiro_crew/cli_commands_agent.py:283 -- CLI adoption leaves the retained DM pinned to the deleted mate
[BLOCK-MERGE] ab17a57 Adjudication (Opus 5.5) — is blocking on each finding proportionate?F2 — MEDIUM harm. Opening the chat for a mate created from the CLI with an adopted store is refused with a 409 until someone closes the old slot or restarts the gateway. Nothing retries or recovers on its own.
F1 (fenced) — Deleting a mate does not close its live DM slot; False positive or not applicable? A repository writer can comment: |
Opus 5.5 Review — 🔴 changes requested (blocking)Reviewed BLOCK: when a crewmate adopts kept memory through the new CLI flag, the deleted crewmate's open thread is never closed, so the new crewmate's thread refuses to open while the gateway runs. This PR closes that thread only on the dashboard create path. BLOCKING — src/kiro_crew/cli_commands_agent.py:283 [BLOCK-MERGE] ab17a57 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Deleting a crewmate keeps its memory store, but every route into a member store resolves it through its live owner, so the kept store could no longer be opened, exported or restored, and nothing could give it an owner again. A create can now name a kept store that no crewmate owns (adopt_memory_store on POST /api/agents, --adopt-memory-store on `kirocrew agent create`). The new crewmate is bound to the store's own recorded member id: nothing is copied and the database identity is unchanged; only the record's display owner follows the new name. It is refused for a store that has an owner, an undeclared or default store, a database whose identity does not match its record, an id a legacy crewmate derives as its slug, and a kept chat-thread binding keyed by a former name only. A name match never adopts, so a same-named create still starts fresh, and export, restore and import keep requiring a live owner. GET /api/memory/ownerless-stores lists the stores on offer (owner-gated), and the create dialog offers them under Advanced settings when there are any. The delete pane and its confirmation now say the memory is kept and that a new crewmate can start from it later, in every shipped locale. Fixes #22487
…p a stale pick visible The create's locked write now refuses a crewmate written meanwhile whose name derives the adopted member id as its slug. The create dialog sends a kept-memory pick as picked, so a pick that went stale is refused by the server, and after that refusal the pick returns to an empty memory.
… kept memory fails to load A crewmate that adopts a kept store derives the deleted crewmate's thread key. A slot still live there kept the deleted name and the open refused it (409 member_pin_mismatch). The create now closes that slot the way the tab close does, so the next open rehydrates it from history under the new crewmate. The New mate dialog says a failed kept-memory read in its options notice instead of offering nothing, and the feature map names the Memory choice and GET /api/memory/ownerless-stores. Part of #22487
b46c0d7 to
ab17a57
Compare
|
Rebased on main and addressed the GPT 6.1 findings on b46c0d7 in ab17a57:
Rebase note: main renamed crewmate to mate in UI copy and dropped Built from and the second Create button. The delete strings keep main's wording in every locale; English adds that a new mate can start from the kept memory. Also fixed the two comment-history hits. |
|
[operator: bolichen97] Continuing this in #33148; thanks for the start. |
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
|
Closing: bolichen97 is continuing this work in #33148. Written by the Crew Tasks Bot on behalf of mbriones98. |
Pull request was closed
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Deleting a bot keeps its memory store on disk, but every route into a member store resolves it through its live owner, so the kept store could not be opened, exported, restored or picked again, while the delete text read as if the memory were safe. A new bot created from the dashboard can now take over a kept store that no bot owns: the New bot dialog offers it under Advanced settings, POST /api/agents binds the new bot to the store's recorded member id, and GET /api/memory/ownerless-stores lists what is on offer. Nothing is copied. The create clears every approval grant on that thread's session and closes the deleted bot's thread still live on that key, so its pin and grants do not carry over, and the delete text says a new bot can start from the memory. Builds on #22947 by @mbriones98.
Problem / Motivation
Goal: A crewmate created after another was deleted can start from the deleted crewmate's kept memory, and the delete confirmation says that the memory is kept.
When you delete a crewmate, its memory store is kept on disk, but nothing could attach that store to a crewmate again. Creating a crewmate always made a fresh store, and export, restore and import all need a live owner. The delete confirmation said the memory was kept but "you would have to set it up again", and no setup path existed.
Why it matters
Anyone who deletes a crewmate by mistake, or wants to rebuild one under a new name, loses everything it learned, even though the data is still there. The delete warning implied a recovery the product did not offer.
Not a goal
What changed (motivation → approach → change)
Symptom → cause: the persistence layer already accepts a member record bound to an existing store's
owner_member_id, but every create path allocated a fresh store and never offered that binding.Approach: let the create bind to a kept store's existing identity instead of allocating one. This copies nothing and keeps every existing guard. The alternatives (copying the store into a fresh one, or relaxing the import/restore owner check) would have rewritten identity or widened a guard.
Change:
member_memory_adoptmodule lists kept member stores that no crewmate owns. It also binds a new crewmate to one by name. A store is refused when a crewmate holds its id or binds it, and when an old-style crewmate (one with no member id) derives that id as its slug. It is also refused when the database identity is not exactly(owner_member_id, store), or when a kept chat-thread binding is keyed only by a former name. A name match never adopts. Adopting reuses the old crewmate's member id, so its kept chat thread, rules and activity follow the new crewmate too; this is the one exception to the rule that a new member id never reuses a kept store's owner id.persist_member_configre-checks under its lock that no crewmate written in the meantime binds the store, holds the id, or derives it as its slug.POST /api/agentsacceptsadopt_memory_store, andGET /api/memory/ownerless-storeslists what is on offer (owner-gated like the other memory routes). If the create fails after the adopt, the store is left exactly as it was.kirocrew agent create --adopt-memory-store <store>.memory-skills-hooks.mdandlearn-cron-dashboard.mddescribe the adopt path.Backwards compatibility
Compatible: the new request field and CLI flag are optional and default to today's fresh allocation, and the new route is additive. No existing input is rejected.
Removes nothing: the diff only adds an optional create path and changes wording. Deleting a crewmate still keeps its store, as before.
Tests
test/test_member_memory_adopt.py(21 tests) covers:NewCrewmateDialog.test.tsxchecks that the Memory field shows only when kept stores exist and sends the picked store. It also checks that a refused pick resets to an empty memory and re-reads the list.CrewEditorNextDialog.test.tsxchecks the new delete wording.Manual verification
I captured the create dialog with the real component against stubbed
/apiresponses (Vite + Playwright, dark and light). With one kept store on offer, the Memory field appears under Advanced, lists "Kept memory of Reviewer" beside "Start with an empty memory", and shows the pick with its hint. The backend path is covered by the tests above, not by a manual run.Screenshots / video
Create dialog with the Memory list open (dark), and with a kept memory picked (light):
The other theme of each state
The delete confirmation only changes its sentence; its layout is unchanged. The English text now reads: "Delete crewmate {{name}}? New chats will no longer use it. Its files, memory and past conversations are kept, and a new crewmate can start from its memory later."
Related Issues
Fixes #22487
Pattern harvest
Rule candidate: review-prompt
Pattern: an identity or ownership check run on a config snapshot needs a twin inside the locked write that publishes it, and a UI that filters a stale pick out of the request should send it and let the server refuse it instead.
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.