fix(desktop): require manual send for restored queue entries - #66240
fix(desktop): require manual send for restored queue entries#66240AlMcClaw-ctrl wants to merge 1 commit into
Conversation
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Fix prevents auto-draining queue entries restored from a previous Desktop process. The new requiresManualSend flag correctly distinguishes fresh entries from persisted ones, and canAutoDrainQueuedPrompt gates the drain loop. Good test coverage.
Reviewed by Hermes Agent
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved (LGTM)
Overview
Requires manual send for restored queue entries in desktop. +68/0.
Security
- No hardcoded secrets or credentials
Code Quality
- Clean UX fix for queue restoration
Looks Good
- Well-scoped fix
Reviewed by Hermes Agent
|
Thanks for the focused queue-safety fix. The premise remains reproducible on current main: The PR gates both of those drain paths and retains explicit Automated hermes-sweeper review. |
Summary
Problem
Desktop persists queued prompts, including attachments, in
hermes.desktop.composerQueue.v1. On a later app process,load()rehydrated those entries without distinguishing them from prompts queued during the current run. Both auto-drain paths only checked whether the target session was idle and the queue was non-empty.That allowed an old unsent prompt, including its image attachment, to be submitted automatically after a later restart/reconnect/session rebind. In the reproduced case, the queue entry was almost one month old and had never been explicitly sent by the user.
A composer queue is an immediate sequencing mechanism, not a delayed-job scheduler. Process-restored entries should therefore require renewed user intent.
Fix
load()tags persisted entries withrequiresManualSend: true.canAutoDrainQueuedPrompt()gates both:useComposerQueuefor the mounted/visible sessionuseBackgroundQueueDrainfor offscreen sessionsManual
sendQueuedNow()remains unchanged, so restored prompts are not lost and can still be explicitly submitted.This is complementary to #56444. That PR preserves source-session affinity for active queue drains; this change prevents a persisted entry from automatically draining at all after a new Desktop process starts.
Tests
NODE_OPTIONS=--no-experimental-webstorage npx vitest run --project ui src/store/composer-queue.test.ts src/app/session/hooks/use-background-queue-drain.test.tsxNODE_OPTIONS=--no-experimental-webstorage npm run typecheckNODE_OPTIONS=--no-experimental-webstorage npm run lint