Repository navigation
fix(webui): clear a created session's sending flag, and type the memory hand-off's line once - #248
Merged
Merged
Conversation
added 2 commits
October 24, 2026 08:55
…ated A first message on the home surface creates the session it is sent to, and the turn's record moves onto it. The turn's own cleanup read the live slice through the key the turn started from, so it looked at the home slot the record had already left, decided the turn no longer owned the stream, and skipped the cleanup that clears the sending flag. The flag therefore stayed standing on the created session. The composer's send button remained a stop button — which swallows the click that was meant to send — and the message after the first one was admitted as a queued one instead of being sent. The reader is now asked for the key the turn's record is filed under, which is the created session's once the first message has created it. The key travels with the submission, so the read follows the same move the writer's own writes already followed. Two cases in the unit suite pin it: the flag is cleared on the created session, and the message after the first one is sent rather than queued. Both fail on the trunk with the symptoms above.
「在会话中创建」 on 记忆摘要 opens the home composer with the memory file attached and one line already typed. The line was written by an effect that watched the selected session, and the hand-off was never cleared, so every later visit to the home surface — a session, a back, a new task, a deleted session — ran the effect again and replaced whatever the user had written with "我想调整下这个记忆文件". The hand-off is one-shot, and so is everything it brings. The file it attaches is held by the composer's consumed seed token; the line is now held by a latch of the same kind. The decision is a pure function next to the hand-off's own contract, and the shell keeps the token of the hand-off whose line it has typed. The line is still typed when the hand-off opens the home surface, and it is still typed into the home slot rather than the one the shell considered current when the hand-off was made.
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.
Two product bugs, both reproduced before anything was changed, each with a unit case that fails on the trunk and passes here. The two commits are independent: the first touches the turn commands, the second the shell and the hand-off's contract.
The first is the sending flag on a session the first message created. A first message on the home surface creates the session it is sent to, and the turn's record moves onto it. The turn's own cleanup read the live slice through the key the turn started from, so it looked at the home slot the record had already left, decided the turn no longer owned the stream, and skipped the cleanup that clears the sending flag.
The flag therefore stayed standing on the created session. The composer's send button remained a stop button — which swallows the click that was meant to send — and the message after the first one was admitted as a queued one instead of being sent.
The reader is now asked for the key the turn's record is filed under, which is the created session's once the first message has created it. The key travels with the submission, so the read follows the same move the writer's own writes already followed.
The second is the memory hand-off's line. 「在会话中创建」 on 记忆摘要 opens the home composer with the memory file attached and one line already typed. The line was written by an effect that watched the selected session, and the hand-off was never cleared, so every later visit to the home surface — a session, a back, a new task, a deleted session — ran the effect again and replaced whatever the user had written with "我想调整下这个记忆文件".
The hand-off is one-shot, and so is everything it brings. The file it attaches is held by the composer's consumed seed token; the line is now held by a latch of the same kind. The decision is a pure function next to the hand-off's own contract, and the shell keeps the token of the hand-off whose line it has typed.
The line is still typed when the hand-off opens the home surface, and it is still typed into the home slot rather than the one the shell considered current when the hand-off was made.
The two cases that pin this are
packages/webui/test/unit/conversation-turn-commands.test.ts(the flag is cleared on the created session, and the message after the first one is sent rather than queued) andpackages/webui/test/unit/personalization-settings.test.tsx(the hand-off's line is typed once, and the shell consults the latch instead of writing the line itself). The first case fails on the trunk withsendingstill true and the second message admitted asqueued; the second fails on the trunk because the shell writes the line straight into the draft.