fix(desktop): avoid drafts from persistent agent hydration - #3900
Open
MajorTal wants to merge 1 commit into
Open
fix(desktop): avoid drafts from persistent agent hydration#3900MajorTal wants to merge 1 commit into
MajorTal wants to merge 1 commit into
Conversation
Contributor
|
good catch on hydration drafts. does the same path fire for persona reloads after reconnect, or only the initial managed-agent hydrate? |
Contributor
Author
|
Good question! The fix covers the exact composer state created by persistent-agent hydration, including after sending. A persona reload on the same thread does not trigger hydration by itself, but if reconnecting remounts the composer, it goes through the same protected path. I do not have a reconnect-specific test yet, so happy to add one if there is another path I missed. |
MajorTal
force-pushed
the
codex/fix-3376-thread-drafts
branch
from
August 5, 2026 10:15
b3fade7 to
09c8b7d
Compare
MajorTal
marked this pull request as ready for review
August 7, 2026 12:41
MajorTal
force-pushed
the
codex/fix-3376-thread-drafts
branch
from
August 10, 2026 10:09
09c8b7d to
f3dfc3d
Compare
Signed-off-by: Tal Weiss <major.tal@gmail.com>
MajorTal
force-pushed
the
codex/fix-3376-thread-drafts
branch
from
August 12, 2026 14:59
f3dfc3d to
1b44b46
Compare
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.
Hey good people, I'm Tal and this is my first contribution to this (awesome) project. It's a bug that was bothering me while dogfooding Buzz. I hope it's in good order...
Summary
Opening a thread with Keep addressed agents active enabled hydrated the composer with programmatic agent mentions. When the thread unmounted, the normal draft lifecycle serialized those mentions as if the user had authored them, creating an Inbox draft without any user input.
This change records the exact editor state produced by persistent-agent hydration and resolves only that unchanged state to empty content when persisting a draft. Any user edit makes the content differ and is preserved normally. Existing mention-only drafts, attachment-only drafts, thread switches, and the post-send recipient state are covered by regression tests.
User impact: viewing a thread no longer creates a ghost draft, while real unsent content and attachments continue to be saved.
Related issue
Fixes #3376.
No duplicate open PRs were found for this issue.
Testing
. ./bin/activate-hermit && just ciMessageComposerDraftImagePersist.test.mjspersistent-agent-audience.spec.ts, including the full open-thread/leave-thread draft regressionManual verification:
There is no visual or layout change, so a before/after screenshot would be identical; this PR changes only draft-persistence behavior.