Skip to content

feat(session): let a user keep an ephemeral chat as persistent - #9750

Merged
bolichen97 merged 1 commit into
kirodotdev:mainfrom
amadsalmon:feat/promote-ephemeral-session
Nov 7, 2026
Merged

bolichen97 merged 1 commit into
kirodotdev:mainfrom
amadsalmon:feat/promote-ephemeral-session

Conversation

@amadsalmon

@amadsalmon amadsalmon commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

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

  • Changing the privacy of the original ephemeral chat or its earlier turns. It stays exactly as private as it was.
  • Any agent, MCP tool or CLI path to promotion. Only a person at the dashboard can do it.
  • Keeping part of a conversation. Promotion always copies all of it.

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.

Part What it does
Route POST /api/chat/slots/{slot}/promote in src/kiro_crew/dashboard/chat_fork.py, chat.py and routes/chat.py. It is an ordinary fork through a keyword-only _promote_from_ephemeral flag that only this route sets: same save, same failure handling, same fork_corpus_too_large limit. Body fields are ignored, so the copy is always the whole chat. An already-persistent slot gets slot_already_persistent.
Owner only The route requires is_owner_dashboard_request. Any other caller, an app token included, gets 403 promote_requires_dashboard_user. Success and every refusal are SEL-audited as chat.slot_promote.
Mode The copy is bound through ExecutionContext.promoted_to_persistent() in src/kiro_crew/execution_context.py, the only method that loosens a mode. with_mode still only tightens.
Copy Promotion keeps every renderable row, including system rows such as a Stop notice, with their stored 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.
Frontend A Keep this chat item in the header menu (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.ts confirms, promotes through the promoteSlot thunk (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.
Dialog and copy The dialog says the original stays private and unchanged, and uses the primary button style. website/src/components/ConfirmDialog.tsx renders a text body with whitespace-pre-line, so the temporary-mode caveat is its own paragraph. Strings are in all 12 locales under website/src/i18n/locales/.
Docs docs/system-specs/modules/history.md and docs/feature-map/README.md.

Backwards compatibility

Compatible: this adds one route, one menu item and one ExecutionContext method. 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 their cls included. 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-capacity fork_corpus_too_large answer with no slot created, and that no MCP tool or CLI command reaches promotion. The non-owner, over-capacity and cls tests 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_execution as the only caller of promoted_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.tsx runs 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.tsx covers the phone menu.

Manual verification

Driven against an isolated gateway from this worktree with the offline harness (spawn_feature_gateway and 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.tsx covers.

  1. Header menu on an incognito chat, with Keep this chat

    01-menu-incognito.png

  2. Confirm dialog, incognito ("The original stays private and unchanged.")

    02-dialog-incognito.png

  3. Confirm dialog, temporary, with the stored-memory caveat as its own paragraph

    04-dialog-temporary.png

  4. The kept session, ↳ Kept: Trip planning notes, with the original still in the sidebar

    05-kept-session.png

  5. Failure notice "Couldn't keep this chat. Try again."

    06-failure-toast.png

  6. Phone width (390 px), session menu on an incognito chat

    07-phone-menu.png

  7. Phone width, confirm dialog

    08-phone-dialog.png

  8. Dark theme, confirm dialog

    09-dialog-dark.png

  9. 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_large

    10-too-long-notice.png

  10. The header menu reopened while a keep is still running, with Keep this chat disabled

11-menu-keep-in-progress.png

Related Issues

Fixes #9694

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (docs/system-specs/modules/history.md)
  • No secrets, credentials, or internal references in the diff

@amadsalmon
amadsalmon requested review from a team and hoang-phan98 September 9, 2026 17:04
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 981a3a144077e1dde537954a3115e49f13ee2f09 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • In ChatHeaderMenu.tsx, the greyed-out Keep this chat (attachment-10) gives no sign that a keep is still running. Showing a spinner, or relabelling the item to something like "Keeping…" while promoting is true, would tell the user the copy is on its way.

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

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 981a3a144077e1dde537954a3115e49f13ee2f09 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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

  • api_chat_slot_fork now takes a private keyword flag, which spreads promote branches through the shared fork path in fork_slot (row filter, cls, title, mode, bind, auto-title). If promotion keeps diverging from an ordinary fork, a small options object passed from the route would hold those differences in one place instead of a growing set of if _promote_from_ephemeral branches.

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 981a3a144077e1dde537954a3115e49f13ee2f09 via the fork AI-review pipeline — 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 does not.

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 audit_operation seam, and ordinary forks still never loosen the mode.

What this change ships

Inventory (10 items) — 9 justified

Intent: let a person keep an incognito or temporary chat as a normal saved session, while the original stays private. ADDITION.

  1. A Keep this chat item in the header overflow menu, shown only on incognito and temporary chats — justified
  2. The same item in the phone session menu — justified
  3. A confirmation dialog, with an extra caveat paragraph for temporary chats — justified
  4. A new POST /api/chat/slots/{slot}/promote route, owner-only and SEL-audited as chat.slot_promote — justified
  5. The kept copy carries every renderable row with its stored cls, and App Kit notes are re-stamped for the copy — justified
  6. The copy is titled ↳ Kept: <title> and is never auto-retitled — justified
  7. ExecutionContext.promoted_to_persistent(), the only method that loosens a mode — justified
  8. Every confirm dialog with a text body now shows line breaks (whitespace-pre-line) — rides along: a global change to a shared component
  9. Separate notices for a failed keep and for a chat too long to keep — justified
  10. The copy opens with its folder expanded, unless the user has moved to another session — justified

[FIRST-PRINCIPLES-REVIEWED] 981a3a1

Description read

[DESCRIPTION-READ] 6def93d7c143de990b70311a2a6da65d770ed77212cf018bdb2944370901841e

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 Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 981a3a144077e1dde537954a3115e49f13ee2f09 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 981a3a1

@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 981a3a144077e1dde537954a3115e49f13ee2f09 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 981a3a1

@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 Sep 9, 2026
@amadsalmon
amadsalmon force-pushed the feat/promote-ephemeral-session branch from 1f57f1b to 86bbf13 Compare September 9, 2026 22:46
@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 9, 2026
@amadsalmon amadsalmon closed this Sep 9, 2026
@amadsalmon amadsalmon reopened this Sep 9, 2026
@amadsalmon
amadsalmon force-pushed the feat/promote-ephemeral-session branch 2 times, most recently from 1915ddc to 4efc176 Compare September 10, 2026 09:12
@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 merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Sep 10, 2026
@amadsalmon
amadsalmon force-pushed the feat/promote-ephemeral-session branch 2 times, most recently from 6d33fca to 7ed2303 Compare September 10, 2026 12:48
@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 readiness: checking Automated validation is still running labels Sep 10, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

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. with_mode still only tightens. The promote route refuses every caller except the dashboard owner and writes an SEL record. Every AI lane passes, checks are green, and the branch merges cleanly with main.

What holds it:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated route.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has recorded that it accepts this exception to history.md's fork rule.

This clears once a maintainer records the decision on #9694 and reviews the route and the mode change.

— crew-pr-reviewer (r130)

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 7557a00 for a maintainer.

This head is 608d72a rebased onto main. The only patch change is the new gesture column in the switch-slot call-site classification test, so the production code is the same as the head I held in r130. I found no code defect. Every AI lane passes and checks are green.

What holds it:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated promote route.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has ruled that it accepts this exception to history.md's fork rule.

This clears once a maintainer records the decision on #9694 and reviews the route and the mode change.

— crew-pr-reviewer (r133)

@iamwhatever

Copy link
Copy Markdown
Contributor

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:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated promote route.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has ruled that it accepts this exception to history.md's fork rule.

This clears once a maintainer records the decision on #9694 and reviews the route and the mode change.

— crew-pr-reviewer (r135)

@iamwhatever

Copy link
Copy Markdown
Contributor

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. with_mode still only tightens, and the promote route refuses every caller except the dashboard owner and writes an SEL record. Every AI lane passes and every check is green.

What holds it:

  1. Merge conflict. GitHub reports the branch as conflicting; it conflicts with main in docs/feature-map/README.md. Please rebase.
  2. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated route.
  3. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has ruled that it accepts this exception to history.md's fork rule.

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)

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does eacd64ca924773c6e0afdfa0eaec81000fd9e2a8 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

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 [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at eacd64ca924773c6e0afdfa0eaec81000fd9e2a8 for a maintainer.

This head is cd3bb61 (our r144) rebased. The range-diff changes only docs/feature-map/README.md, so the merge conflict r144 reported is resolved and the production code is unchanged. I found no code defect. The promote route refuses everyone except the dashboard owner, and with_mode still only tightens. CI and every AI lane are green.

What holds it:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated route.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has accepted this exception to history.md's fork rule.

AI findings judged non-blocking:

  • UX: the dialog's You'll be taken to it. is not true when the user has moved to another session meanwhile. This is a copy nit, and the copy still appears in the sidebar.
  • UX: the greyed-out item does not say why while a keep runs. This is polish.
  • Design: the confirm dialog, rather than the copy, is what protects the user. The dialog says everything is kept.
  • Opus: the committed screenshots under temp-screenshots/ are evidence files, which a fork PR has to commit.

— crew-pr-reviewer (r145)

@bolichen97

Copy link
Copy Markdown
Contributor

Holding at eacd64c. The change itself reads well, and CI is green on this head, but two things block merge.

  1. The branch now conflicts with main. Please rebase onto current main.
  2. The tip commits 10 screenshots under temp-screenshots/promote-ephemeral-session/. Those are evidence for review, not repository content. Please drop them from the branch when you rebase.

What I checked on this head:

  • The promote route is the only path that loosens a chat's memory mode, and it is owner-only. App tokens and non-owner dashboard users get 403, and the refusal is audited.
  • The internal flag that allows loosening is keyword-only and cannot be set from the request body. On promote the body is ignored, so the whole chat is always copied and the original ephemeral session is left as it was.
  • Copied rows still go through the existing credential and URL redaction, and transient rows (permission, elicitation, streaming) are not copied.
  • No regex or pattern matching is added.

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.

@amadsalmon

amadsalmon commented Nov 4, 2026 •

Copy link
Copy Markdown
Member Author

@bolichen97 thanks for the review. Both points are done in f99bf213b6:

  1. Rebased onto main 61ff60332b. The one conflict was main's new vouch=source_vouch_agrees(...) at the fork bind, which is the same call where this PR promotes the execution. Both are kept: the vouch only compares member and store, and promotion changes only the memory mode.
  2. Screenshots dropped from the branch. The PR description shows the same 10 images as uploaded attachments.

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

@bolichen97

Copy link
Copy Markdown
Contributor

Correction to my earlier comment: please ignore the request to remove the screenshots under temp-screenshots/promote-ephemeral-session/. Committing review screenshots there is the normal pattern in this repository, so they can stay.

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.

@bolichen97

Copy link
Copy Markdown
Contributor

Thanks for this PR. On head 299f239 the reds are:

  • Backend Tests (3.12, 5), with Coverage Gate failing after it: one case of test/test_decisions_end_to_end.py::test_jev_response_reaches_the_assembled_message fails (assert 0 == 1). This diff does not touch that area, and the same test fails the same way on other open PRs today.
  • Opus 5.5 Review: the check reports "could not run", so there is no verdict for this head yet.

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.

@amadsalmon

amadsalmon commented Nov 5, 2026 •

Copy link
Copy Markdown
Member Author

@bolichen97 thanks, done. 7b5db0d0e8 is rebased onto main 52f209b61d, which includes #29623, as one commit.

While it was being rebased I also fixed one spec line the incomplete Opus run had pointed at. history.md said an app credential always gets the 403 promote_requires_dashboard_user. An app that does not own the slot actually gets 404 slot_not_found from the ownership check first, which is what test_an_app_token_cannot_promote_a_slot_it_does_not_own asserts. The spec now says both.

— Sent by an AI Agent on behalf of Amad

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 7b5db0d0e88c7ec5ddfc0a4d7d0c2bbc8cb093b0 for a maintainer.

This head is the earlier PR rebased onto main 52f209b61d as one commit. I found no security defect. The promote route refuses everyone except the dashboard owner before it reaches the fork code, the request body is ignored, an already-persistent slot gets slot_already_persistent, and with_mode still only tightens. All 93 check runs on this head are success or skipped, PR Readiness is success, and every AI lane (Opus, GPT, Design, UX, First Principles, Security Scope) is green on this head.

What holds it:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated route, POST /api/chat/slots/{slot}/promote.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still labelled needs-human. No maintainer has recorded acceptance of this exception to history.md's fork rule. The author asked for that ruling on Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 on 2026-10-27.

One question for the human reviewer (I did not run it):

  • The promoted bind passes vouch=source_vouch_agrees(source, promoted_execution). source_vouch_agrees compares memory_mode too, and an ephemeral source is never vouched, because a restricted bind withdraws the vouch. So a kept copy of a member (V2) conversation looks like it is bound persistent but unvouched, and session_create reads that vouch for own-store admission. If so, that kept copy can never create own-store sessions. It fails closed, so it is not a privacy risk, but the author's 11-04 comment says the vouch compares only member and store, and no test promotes a member conversation. Please confirm whether this is intended.

AI findings judged non-blocking:

  • UX: "Couldn't keep this chat" can show while another session is open, so "this chat" is ambiguous. Copy nit; the original is unchanged and the hook still shows the notice.
  • Design: the loosening branch lives on the shared fork path and relies on a call-site pin test. The pin test is in the diff and the flag is keyword-only.
  • Design: whitespace-pre-line in ConfirmDialog affects every text body. It only changes strings that already contain line breaks, which previously collapsed.

— crew-pr-reviewer (r146)

@amadsalmon

Copy link
Copy Markdown
Member Author

Thanks, the reading is right on 7b5db0d0e8, and my 11-04 comment was wrong. When I wrote it, source_vouch_agrees compared only member and store. Main has since added memory_mode to that comparison, and an incognito or temporary source never holds a vouch anyway, because the restricted bind withdraws it. So for a kept copy of a member conversation, source_vouch_agrees returns False. The copy is bound persistent but unvouched, and its own-store session_create is refused.

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

@iamwhatever

Copy link
Copy Markdown
Contributor

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. with_mode still only tightens. Every check and AI lane on this head is green.

What holds it:

  1. Reserved for a human reviewer. promoted_to_persistent is the first way to loosen a chat's privacy mode, and it ships with a new owner-gated route, POST /api/chat/slots/{slot}/promote.
  2. Open product decision. Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want) #9694 is still needs-human. No maintainer has recorded that Keep this chat is an accepted exception to history.md's fork rule.
  3. The vouch question from r146 is confirmed but not decided. A kept copy of a member conversation is bound persistent but unvouched, so it cannot create own-store sessions (chat_fork.py#L142-L158). The author confirmed this reading and is waiting for a ruling. It fails closed, so it is not a privacy risk. The maintainer should say whether it is intended, and either way a test that promotes a member conversation would pin it.

AI findings judged non-blocking:

  • Design: the comment at chat_fork.py#L453 says the request cannot loosen the mode, beside the promote branch. That sentence is about the request body, and the lines after it name promotion as the exception, so this is comment wording only.
  • UX: the too-long notice gives no next step, and there is no visible pending state after confirming. Both are polish. The item is disabled while a keep runs, and failures show a notice.

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote an ephemeral session to persistent mid-conversation (keep a chat you decided you want)

6 participants