fix(desktop): discard draft on explicit new session - #62579
Open
sitkarev wants to merge 1 commit into
Open
Conversation
Contributor
|
Thanks for covering the explicit New Session entry points and the cached-agent config gap. Problems
Suggested changes
Automated hermes-sweeper review. |
This was referenced Jul 12, 2026
19 tasks
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.
Summary
__new__composer draft only for explicit Desktop New Session actions, preventing a prior unsent prompt from appearing or being submitted in a nominally fresh chat.compression.in_placein the gateway agent-cache signature so changing durable-ID compaction mode reconstructs cached agents.Details
The composer owns both its live contenteditable state and the persisted scratch scope. New Session now dispatches a deferred, scoped clear after session/route state changes, and the listener only clears while the composer is in the null/new-chat scope. Explicit entry points covered: sidebar New Session, global keybind,
/new, profile-driven new sessions, and workspace/project lanes.Validation
npm run test:ui -- src/app/session/hooks/use-session-actions.test.tsx src/store/composer.test.ts— 24 passednpm run typecheckuv run pytest tests/gateway/test_agent_cache.py -q -o 'addopts='— 79 passedpython3 -m py_compile gateway/run.pygit diff --checkRisk / rollback
The clear is opt-in per explicit New Session path; automatic recovery preserves unsent drafts. Reverting commit
f0b728ce3restores the prior behavior.