Repository navigation
feat(session): let a user keep an ephemeral chat as persistent - #9750
Conversation
UX Review (Opus 5.5, fork) — ✅ PASSUX-level review of UX-Verdict: PASS No blind read in this fork lane. All ten screenshots show every control and state the diff adds (menu item, both dialogs, kept copy, failure and too-long notices, phone, dark theme, disabled item), so there is no evidence gap. Notes
[UX-REVIEWED] 981a3a1 Description read[DESCRIPTION-READ] f3789e7785dc23ec8a5792747a870f0c4101c8cbef06af5d3082e0252c2f3434 That sha256 names everything this verdict read: the PR description, plus the 13 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 |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the copy-not-rewrite approach keeps earlier ephemeral turns private, nothing is taken away, and the description includes rendered evidence. Notes
[DESIGN-REVIEWED] 981a3a1 Description read[DESCRIPTION-READ] 17c89fe51eb1c80833fcc97c00f1173cb39a91962f2c7e28a43043a85767c0f1 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 |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The feature is opt-in and sits beside the existing modes without changing any default. It reuses the fork machinery and its What this change shipsInventory (10 items) — 9 justifiedIntent: let a person keep an incognito or temporary chat as a normal saved session, while the original stays private. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] 981a3a1 Description read[DESCRIPTION-READ] 6def93d7c143de990b70311a2a6da65d770ed77212cf018bdb2944370901841e That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
1f57f1b to
86bbf13
Compare
1915ddc to
4efc176
Compare
6d33fca to
7ed2303
Compare
|
HOLD at 608d72a for a maintainer. This head is e57a450 rebased onto main. The PR's own patch is identical, and I found no code defect. Promotion is a whole-transcript fork, and the original keeps its mode. What holds it:
This clears once a maintainer records the decision on #9694 and reviews the route and the mode change. — crew-pr-reviewer (r130) |
|
HOLD at 7557a00 for a maintainer. This head is 608d72a rebased onto main. The only patch change is the new What holds it:
This clears once a maintainer records the decision on #9694 and reviews the route and the mode change. — crew-pr-reviewer (r133) |
|
HOLD at 21594a1 for a maintainer. This head is 7557a00 rebased onto main. The only patch change is the feature map's Sessions row, where this PR's Keep this chat text is re-applied onto main's new wording; the production code is the same as the head I held in r133. I found no code defect. Every AI lane passes, all 89 checks completed without a failure, and the branch merges cleanly with main. What holds it:
This clears once a maintainer records the decision on #9694 and reviews the route and the mode change. — crew-pr-reviewer (r135) |
|
HOLD at cd3bb61 for a maintainer. This head is 21594a1 (our r135) rebased: the range-diff shows only re-applied call sites and props on main's changed code, so the production logic is unchanged. I found no code defect. What holds it:
This clears once the conflict is resolved, a maintainer records the decision on #9694, and a person reviews the route and the mode change. — crew-pr-reviewer (r144) |
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does the review scope was never resolved: the generate job did not finish (it timed out, failed or was cancelled), so no leg ran; its log names the step that stopped No |
|
HOLD at This head is cd3bb61 (our r144) rebased. The range-diff changes only What holds it:
AI findings judged non-blocking:
— crew-pr-reviewer (r145) |
|
Holding at eacd64c. The change itself reads well, and CI is green on this head, but two things block merge.
What I checked on this head:
Optional: the UX lane suggests showing "Keeping..." on the disabled menu item while a keep is running. I will review again once the rebase lands. |
|
@bolichen97 thanks for the review. Both points are done in
On the optional “Keeping…” label: I've left it out to keep this PR small. I can add it here if you'd like it before merge. — Sent by an AI Agent on behalf of Amad |
|
Correction to my earlier comment: please ignore the request to remove the screenshots under Thanks for the rebase. The branch now merges cleanly with main at f99bf21. A few checks on this head are still red or running, so I will review it again once CI finishes. |
|
Thanks for this PR. On head 299f239 the reds are:
Main has since changed this test's setup in #29623. A rerun would test the same old merge base, so could you update the branch onto main (rebase, keeping one or two commits for PR Hygiene)? That runs CI and the review lanes again on the current base. |
|
@bolichen97 thanks, done. While it was being rebased I also fixed one spec line the incomplete Opus run had pointed at. — Sent by an AI Agent on behalf of Amad |
|
HOLD at This head is the earlier PR rebased onto main What holds it:
One question for the human reviewer (I did not run it):
AI findings judged non-blocking:
— crew-pr-reviewer (r146) |
|
Thanks, the reading is right on That fails closed, and it is the same outcome the PR had before main's vouch change, when the fork bind passed no vouch at all. It was never a decision, though, and no test promotes a member conversation. I'll come back here once Amad confirms which way it should go. — Sent by an AI Agent on behalf of Amad |
|
HOLD at 1ca3893 for a maintainer. This head is our r146 head (7b5db0d) rebased onto main. The range-diff changes only re-applied context, so the production logic is the same, and I found no code defect. The promote route refuses everyone except the dashboard owner and ignores the request body. What holds it:
AI findings judged non-blocking:
This clears once a maintainer records the #9694 decision, rules on the member-conversation vouch, and reviews the route and the mode change. A new push will need a fresh review. — crew-pr-reviewer (r147) |
Incognito and temporary chats are written to History (decision 2026-09-25), but everything derived from them is withheld: memory, summaries, search. A user who decides such a chat is worth keeping has no way to turn those on for it (issue kirodotdev#9694). Add a dashboard-only "Keep this chat" action to the chat header menu and the phone session menu. After a confirm dialog it copies the whole conversation into a new persistent session and opens it. The original is left as it was, so no turn sent while the user believed the chat was private becomes searchable. POST /api/chat/slots/{slot}/promote is a thin wrapper over the fork path through a keyword-only _promote_from_ephemeral flag that only the route sets. It is an ordinary fork in every other respect: the same save, the same failure handling and the same fork_corpus_too_large capacity guard. The child is bound through ExecutionContext.promoted_to_persistent(), the only method that loosens a mode. The route requires is_owner_dashboard_request; any other caller gets 403 promote_requires_dashboard_user. An already-persistent slot gets slot_already_persistent. Success and refusals are SEL-audited as chat.slot_promote. Promotion copies every renderable row, keeping a system row's stored cls, and titles the copy "Kept: <title>". Copied App Kit note rows are re-stamped for the kept session, because a session's save drops a note stamped for another one; an ordinary fork copies only user and assistant rows, so it never carries a note. The frontend usePromoteSlot hook disables the item while a keep is in flight and shows its own notice for an over-capacity chat. Strings are in all 12 locales. Co-authored-by: bolichen97 <bolichen97@users.noreply.github.com>
bolichen97
left a comment
There was a problem hiding this comment.
Maintainer decision (security sign-off): accepted; loosening, not a tightening.
Approving at 981a3a1. POST /api/chat/slots/{slot}/promote lets the dashboard owner keep an incognito or temporary chat as a persistent one. It refuses everyone else before the fork code runs (an app token gets 403 promote_requires_dashboard_user, or 404 slot_not_found for a slot it does not own), it ignores the request body, and an already-persistent slot gets slot_already_persistent. The internal flag that allows loosening the memory mode is keyword-only and cannot be set from a request. A kept copy of a member conversation stays unvouched, so its own-store writes are still refused, which fails closed. No regex is added. CI is green apart from Publish readiness signal.
Problem / Motivation
Goal: let a user keep an incognito or temporary chat as a normal, saved session, without changing the privacy of the original.
Ephemeral sessions (
memory_mode: incognito | temporary) are written to History (docs/decisions/2026-09-25-incognito-and-temporary-chats-keep-their-transcript.md), but everything derived from them is withheld: memory, summaries, search, consolidation. If a conversation started ephemeral and turns out to be worth keeping — a decision was made, a fact about the user's setup emerged — there is no way to turn those on for it. The only option is to hand-copy content into a fresh persistent chat.The reverse direction already exists: the welcome view offers "Switch to ephemeral mode". Only the promoting direction was missing.
Why it matters
Without it, the conversation the user just decided was valuable never reaches memory, summaries or search. Every workaround is manual re-entry, which loses the assistant's turns entirely.
Not a goal
What changed (motivation → approach → change)
Approach: copy, not an in-place rewrite. The mode is a header on the transcript, so flipping it looks like the fix, but it would make every earlier turn, sent while the user believed the chat was private, searchable and eligible for memory. "Keep this chat" instead copies the whole conversation into a new persistent session and opens it. The original is left exactly as it was.
POST /api/chat/slots/{slot}/promoteinsrc/kiro_crew/dashboard/chat_fork.py,chat.pyandroutes/chat.py. It is an ordinary fork through a keyword-only_promote_from_ephemeralflag that only this route sets: same save, same failure handling, samefork_corpus_too_largelimit. Body fields are ignored, so the copy is always the whole chat. An already-persistent slot getsslot_already_persistent.is_owner_dashboard_request. Any other caller, an app token included, gets403 promote_requires_dashboard_user. Success and every refusal are SEL-audited aschat.slot_promote.ExecutionContext.promoted_to_persistent()insrc/kiro_crew/execution_context.py, the only method that loosens a mode.with_modestill only tightens.cls. The copy is titled↳ Kept: <title>and is not renamed later. Like any fork it is filed in the original's folder, already titled in its first sidebar frame. Copied App Kit notes are re-stamped for the kept session, because a session's save drops a note stamped for another one. An ordinary fork copies only user and assistant rows, so it never carries a note.website/src/pages/chat/ChatHeaderMenu.tsx) and the phone session menu (website/src/pages/chat/page/MobileTopBar.tsx), only on incognito and temporary chats.website/src/pages/chat/usePromoteSlot.tsconfirms, promotes through thepromoteSlotthunk (website/src/store/chat/lifecycle.ts,website/src/api/client/chat.ts) and opens the copy, and its folder in the sidebar, unless the user moved to another session meanwhile (forkMayOpen). Like every fork, it holds the pending-open count until the copy is open, so the chat page does not open another session meanwhile. The item is disabled while a keep is running. A too-long chat gets its own notice.website/src/components/ConfirmDialog.tsxrenders a text body withwhitespace-pre-line, so the temporary-mode caveat is its own paragraph. Strings are in all 12 locales underwebsite/src/i18n/locales/.docs/system-specs/modules/history.mdanddocs/feature-map/README.md.Backwards compatibility
Compatible: this adds one route, one menu item and one
ExecutionContextmethod. Ordinary forks behave as on main.Removes nothing: no route, key, field or behavior main has is removed or narrowed.
Tests
test/test_chat_promote.py: promotion from incognito and from temporary gives a persistent copy of the whole transcript, system rows and theirclsincluded. Note rows are re-stamped. Body fields are ignored. It covers the refusals (already persistent, unknown slot, app token, no app claim, non-owner dashboard user), the SEL records, the over-capacityfork_corpus_too_largeanswer with no slot created, and that no MCP tool or CLI command reaches promotion. The non-owner, over-capacity andclstests each fail without their fix.test/test_promote_flag_call_sites.py: pins the route as the only caller that passes_promote_from_ephemeral, and_bind_fork_executionas the only caller ofpromoted_to_persistent(), under the promote branch only.test/test_chat_fork_error_codes.py: the coded-refusal count, re-derived to 28 on the merged tree.website/src/test/usePromoteSlot.test.tsxruns the real hook and the real menu. It checks the dialog text per mode, that cancel and Escape do nothing, the primary style, the open-failure, generic-failure and too-long notices, one copy on a double trigger, that a keep resolving after the user opened another session leaves them there with the copy listed, that a New chat clicked while a keep runs still opens when the keep answers first, and that the item shows only for incognito and temporary and is disabled while a keep is running.ChatPage.mobileTopBarActions.test.tsxcovers the phone menu.Manual verification
Driven against an isolated gateway from this worktree with the offline harness (
spawn_feature_gatewayand the packaged fake ACP backend: no model, no credentials, no network), using the real menu item and dialog.Screenshots / video
Captured with the website's Playwright against that gateway, on this head's tree. A keep that finishes after the user opened another session shows nothing new: the user stays where they are and the copy appears in the sidebar, which
usePromoteSlot.test.tsxcovers.Header menu on an incognito chat, with Keep this chat
Confirm dialog, incognito ("The original stays private and unchanged.")
Confirm dialog, temporary, with the stored-memory caveat as its own paragraph
The kept session,
↳ Kept: Trip planning notes, with the original still in the sidebarFailure notice "Couldn't keep this chat. Try again."
Phone width (390 px), session menu on an incognito chat
Phone width, confirm dialog
Dark theme, confirm dialog
Too-long notice "This chat is too long to keep. The original stays in history.", after the promote request is answered with
fork_corpus_too_largeThe header menu reopened while a keep is still running, with Keep this chat disabled
Related Issues
Fixes #9694
Checklist
docs/system-specs/modules/history.md)