Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
geoolekom
force-pushed
the
soft-chat-delete
branch
from
December 3, 2026 19:42
000226a to
610339d
Compare
Signed-off-by: Yehor Komarov <10210242+geoolekom@users.noreply.github.com>
geoolekom
force-pushed
the
soft-chat-delete
branch
from
December 3, 2026 21:54
610339d to
39de253
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #271 (
phone-chats-into-records); the base moves tomainwhen that one merges.What changed
A chat deleted on the computer is no longer erased. It keeps its records and gets a mark that says it was deleted, and when.
chat-delete <id>andchat-delete allmark the chat deleted instead of removing it. The chat drops out ofchat-list, andchat-getandchat-sendanswer "unknown conversation" for it.chat-deletecounts only the chats it newly marked, so a second delete answers0.sync-chatsgives a deleted chat as an item withdeleted: trueanddeleted_at, an empty title, a count of 0 and no turns. The chats token changes on a delete, so the phone copies the list again.sync-delete-chatcommand ({"cmd", "id", "time"}) marks the chat the same way, with the time the phone gives. The first time stays if the chat was deleted already. A delete of a chat the computer does not have writes a mark with nothing else, so what the phone sends of it later is refused. It answersinvalid sync requestfor a request of another shape,invalid chatfor a bad id,erasingduring "Delete everything", andbusywhile an answer runs in that chat. The delete takes the same guard as "Delete everything" and checks for an erasure once it holds it, so a delete cannot write a mark after an erasure has begun, the same way a push cannot write records then.deleted: true, with no fork. The same goes for a push whose fork was deleted. A resent push cannot bring the chat back.FORMATgoes from 2 to 3 (deletedanddeleted_aton a chat,sync-delete-chat,deletedon a push answer when it is true).The mark is one hidden
chat_deletedcall with itsnotedresult in the chat's own record file, the same way the chat origin and the other markers are kept. It is hidden from a model and from the earlier-conversation hand-off, like the other markers.Delete everything
"Delete everything" still removes every chat, its records and its mark. The mark lives in the chat's own record file, so removing the files removes the mark too; there is no second store and
agent/src/erase.rsneeds no change. A test deletes chats from both sides, runs the erase and scans the data folder: no chat, no mark, no read position, no record text is left.Time tracker and fact learning
I chose to keep what was already counted or learned, and to refuse new records for a deleted chat, so nothing is counted or learned twice.
chat-sendis refused. Nothing new reaches the recorder or the fact observer, and a resent push cannot make them hear the same turn again.I did not pick the other way (erase the records on delete and subtract what was counted). It would lose what the person did and learned, and it would need a second list of what to take back.
What ran
cargo test --locked --workspace --no-fail-fast: 1404 passed, 1 failed: the timing test named below, which passes alone.cargo clippy --all-targets --locked -- -D warnings(whole workspace): clean.cargo fmt --checkandpre-commit run --all-files: clean.On a busy machine,
a_backoff_is_not_cut_short_by_a_new_prompt(agent/tests/manage.rs) can fail once in a while: it checks with fixed sleeps that no call goes out in 400 ms of an 800 ms pause, and a starved test thread can overshoot that. This change does not touch that code (only a doc comment in the same crate), and it passes on a rerun.New tests show that:
chat-listand marked deleted insync-chats;erasingand marks nothing;