Repository navigation
cmux NEXT Chief chat: delete my messages; the Chief forgets them (#36019) - #36057
Conversation
…hief's memory (#36019) The brain gets a memory editor seam (set/with_memory_editor) and the change book a delete_message entry; nothing calls them yet, so the test fails on the tombstone assertion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…6019) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ef's memory (#36019) Mac Home transcript: my committed message in a Chief chat gets Delete in its context menu. The row leaves at once (the projection shows it retracted until the owner's echo), the owner retracts it (message.retract), and a Chief chat draws no row for a retracted message, so it stays gone after reopen and restart. A refusal brings the row back. Chief: a retraction is logged as 'deleted <id>' (the next turn's delta names the line), and the message's own text in the memory is written over with the tombstone through the inspector's change book (backup, journal, summaries above rebuilt, undoable), so the Memory Inspector and later views no longer hold it. The inspector and the brain share one Editor. iOS keeps its 2-minute Undo Send, which reaches the same memory deletion; parity row added as partial. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A deletion made while the Chief was not listening (restart, lost connection) reaches its memory on the reconnect's catch-up. - The tombstone is written once per message, decided by the change book (has_deleted), so a failed write is tried again and an inspector undo holds across reconnects. - Delete is not offered on read-only, agents, Feed or agent-sent rows. - The projection forgets a delete once the store holds its retraction. - The Swift test deletes a message it sent (the mock owner refuses to retract its generated rows), and names MessagesLabHome.Message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ow (#36019) Drives the right-click's own menu path from the DEBUG socket, so the Chief chat's Delete can be dogfooded on a background tagged app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Correctness review (subagent, correctness-first) and resolutionReviewed head: 329eecf. Fixes landed in f93a011.
The reviewer also checked these and found no issue: no deadlock between the change book and the chat lock; every |
…36019) The conversation list overlays a pending message.retract on the newest message like pin, mute and read cursors, so Delete (and Undo Send) leaves the preview in the same turn as the transcript row; a refusal shows it again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… does (#36019) Review: a refused retract is discarded, never left failed, so the .failed skip was dead and the test drove a state production never reaches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Correctness review 2 (subagent, correctness-first) and resolutionReviewed:
Fleet results: |
Visual review (subagent) at f77f606: NEEDS-HUMAN-TASTE (advisory)Evidence: window snapshots from the real tagged app, fleet build Result: the delete works.
|
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Shipped in:
The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/41990669105 at cf6dec5 failed: cmux-next checks (god files, concurrency, crash safety, l10n). |
|
For awareness: on feat-cmux-next at 76e7f91, |
…ild; tui-kit beacon clippy) (#36608) * test(optchat-chief): the undo after a reconnect's delete waits for that delete's summaries to rebuild Red on every full rust-workspaces run since #36057 (3deee62): the undo raced the editor's rebuild worker and got Editor::undo's documented 409 'its summaries are being rebuilt; try again in a moment'. The Memory Inspector and the memory_edit tests wait (wait_rebuilt) before an undo; this test now does too. * tui-kit: beacon::frame takes the run's Beacon (ws, pane, cell columns), so clippy's too_many_arguments passes cargo clippy -D warnings in scripts/journeys/tui-kit/rust failed (frame took 8 arguments, from #31784); it shows on every full rust-workspaces run (#36427's run changed .github/rust-workspaces.toml). The three values that name a beacon for its whole run are one struct; tk-beacon builds it at the call. * tui-kit: tk-beacon parses its command line into a named Options, so clippy's type_complexity passes
Fixes #36019: in a cmux NEXT Chief chat the user could not delete their own messages.
What changed
Mac Home transcript (MessagesLabHome)
HomeProjection.deleting), so no rebuild brings it back before the owner answers. The owner then retracts it (message.retract, the existing op). A refusal brings the row back and reports throughonRefusal.HomeMapping.hidesRetracted,HomeDiffemits MessagesLab's.deleteinstead of.unsend). The message stays gone after reopening the chat and restarting the app, because the owner keeps the retraction. Other chats keep Messages' "You unsent a message" note.HomeMirror.inboxRowsoverlays a pendingmessage.retracton the newest message the way it already overlays pin, mute and read-cursor intents, and a refused delete shows the preview again. Before, the list kept the deleted text for about a second, until the owner's retraction arrived. iPhone Undo Send gets the same instant preview.home.menu.deleteMessage("Delete"), translated into all 21 locales (copied from the existing Not Delivered "Delete").Chief (optchat-chief)
deleted <id>, the entry kind the view log already had, so the next turn's delta names the line as deleted.(deleted by the user)through the Memory Inspector's change book (Editor::delete_message). That gives it a backup, a journal record, rebuilt summaries above it and an undo, exactly like an inspector delete. The Memory Inspector shows the tombstone and the delete in its change list.Editor, so there is one journal and one rebuild worker.:retracted), so a message an older build already logged is not logged twice.iOS parity: the phone's Chief chat already offers Undo Send (2 minutes, the same
message.retract), so the Chief's memory forgets those messages too. A Delete with no time limit that leaves no note on the phone is recorded as a partial row incmux-next-ios/verify/parity-mac.md.Tests
Regression tests were committed before the fix:
Native/OptChat/optchat-chief/tests/chat_delete.rsdrives the brain. It checks that a retracted message's memory copy becomes the tombstone, that the change book journals a delete, that the next turn's input has|deleted <id>and no part of the text, that a replay is not a second delete, and that after a host restart the memory still holds only the tombstone.nx-36019-red: fails atchat_delete.rs:60, where the memory still holds the deleted text.nx-36019-fix: bothchat_deletetests pass (cargo test --locked --test chat_delete), along withdelta_edit,reply_guarantee,memory_edit,inspect,chief_continue_retryandchief_inbox. A second test,a_message_deleted_while_the_chief_was_down_leaves_its_memory_on_reconnect_and_an_undo_holds, came from review: it also fails on the base and passes on the head.Packages/Shared/CmuxMessagesLab/Tests/MessagesLabHomeTests/HomeChiefDeleteTests.swiftdrives the projection over the mock owner. It checks that Delete removes the row before the owner answers, that the owner retracts the message, and that a reopened chat shows no row and no unsent note. It also checks that the Chief's messages and ordinary chats offer no Delete.c19e9f414251821263e15639(scripts/ci/package-test-lane.sh suite Packages/Shared/CmuxMessagesLab Suites, Xcode 26.6): fails, becausecanDeleteMessageanddeleteMessagedo not exist.99018931a17a3086241892b4, the same command:HomeChiefDeleteTests,HomeChiefRetryTestsandHomeRetrySendTestspass.menu choosepath that the GUI dogfood below uses (one line inDebugHomeNativeFixture.swift, one pass-through); the tests above ran at f93a011.Packages/Shared/CmuxHomeCore/Tests/CmuxHomeCoreTests/MirrorAndIntentLogTests.swiftaPendingRetractClearsTheNewestMessagesPreviewUntilRefusedchecks that the list's preview is empty while the delete is pending and comes back on a refusal.55454276a155a675cf118ce7(scripts/ci/package-test-lane.sh suite Packages/Shared/CmuxHomeCore MirrorAndIntentLogTests): fails atMirrorAndIntentLogTests.swift:71, where the preview still holds the deleted text.3412dbb85084c7a04478075e, the same command: all 7 tests pass.... suite Packages/Shared/CmuxHomeCore CmuxHomeCoreTests, 288 tests in 51 suites, step9724382a2665b889f4042730).HomeChiefDeleteTests,HomeChiefRetryTestsandHomeRetrySendTestsalso pass at the head (stepa6d780b59316818372aac960).Changelog
Observed / Not run
Ran and saw:
a252943d07c19a4658db17a7of the head f77f606, tag36019-chief-chat-message-delete. It ran in an isolated scratch Chief home through the app's DEBUG socket, never the person's cmux. The steps:optchat/memory.sqlite3) held it.debug.home.drive menu {choose}).optchat/memory.sqlite3no longer holds the text.memory-edits.jsonlhas thedelete(message 0 changed to(deleted by the user)) and the rebuilds of summaries0+1and0+2.optchat/backups/memory-*.sqlite3). It is what makes the Memory Inspector's undo work, the same as an inspector delete.tui/<chief>/conversations.sqlite3), which keeps the original send event. That is existingmessage.retractbehavior and the same for Undo Send. Purging it is a follow-up, not in this PR.sample(44 ms), anddeleteMessageitself does one projection pass and hands off the op, so the cause is unknown.Not run, or only read:
MenuActionwith thetrashsymbol.message.retract, so the Chief's memory forgets those too), and the list preview fix applies there as well. A Delete with no time limit on the phone is a partial row incmux-next-ios/verify/parity-mac.md.🤖 Generated with Claude Code