Skip to content

fix(webui): clear a created session's sending flag, and type the memory hand-off's line once - #248

Merged
modacker merged 2 commits into
webuifrom
fix/webui-home-sending-and-memory-handoff
Oct 24, 2026
Merged

modacker merged 2 commits into
webuifrom
fix/webui-home-sending-and-memory-handoff

Conversation

@modacker

Copy link
Copy Markdown
Collaborator

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.

home.sending = false | created.sending = true | created.phase = done

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.

home.sending = false | created.sending = false | created.phase = done

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) and packages/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 with sending still true and the second message admitted as queued; the second fails on the trunk because the shell writes the line straight into the draft.

probe 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.
@modacker
modacker merged commit c915da7 into webui Oct 24, 2026
12 of 14 checks passed
@modacker
modacker deleted the fix/webui-home-sending-and-memory-handoff branch October 24, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant