Skip to content

Queue prompts sent while Claude is working#211

Open
leonidasbarkas98-cpu wants to merge 1 commit into
andrepimenta:mainfrom
leonidasbarkas98-cpu:feat/prompt-queueing
Open

Queue prompts sent while Claude is working#211
leonidasbarkas98-cpu wants to merge 1 commit into
andrepimenta:mainfrom
leonidasbarkas98-cpu:feat/prompt-queueing

Conversation

@leonidasbarkas98-cpu

Copy link
Copy Markdown

Messages sent while Claude is still working are no longer lost or racing the running process: they are enqueued (in-memory FIFO with the full payload incl. plan/thinking mode and images), shown as a greyed-out "Queued" placeholder in the chat, and auto-sent through the normal send path once the running process exits cleanly. There is never a second overlapping claude process — overlapping spawns fight over the session lock and kill the permission channel (#128).

Details:

  • The queue is cleared on Stop/new session, webview reload, process error or non-zero exit (no auto-send into a broken session); placeholders are removed accordingly.
  • The send path stays usable while processing: disableButtons no longer disables the send button (it was its only consumer); the send/stop button swap is unchanged.
  • The loading bubble now carries a dedicated class, so clearing it removes exactly that element instead of guessing by position.
  • close/error handlers ignore stale events from a superseded process, so a late event from the previous process cannot reset the state of the next one started by the queue drain.

Addresses #91. Based on current main (ab6e307), tsc --noEmit clean, no new dependencies.

Messages sent during processing are no longer lost or racing the
running process: they are enqueued (in-memory FIFO, full payload
incl. plan/thinking mode and images), shown as a greyed-out 'Queued'
placeholder in the chat, and auto-sent through the normal send path
once the running process exits cleanly. There is never a second
overlapping claude process — overlapping spawns fight over the
session lock and kill the permission channel (andrepimenta#128).

- Queue is cleared on Stop/new session (_killClaudeProcess), webview
  reload, process error or non-zero exit (no auto-send into a broken
  session); placeholders are removed via queueCleared.
- Send path (Enter) stays usable while processing: disableButtons no
  longer disables the send button (it was its only consumer); the
  send/stop button swap is unchanged.
- Loading bubble now carries a dedicated loading-indicator class;
  clearLoading removes exactly that instead of guessing by position
  (fixes it being leaked when queued placeholders or 'Compacting...'
  messages sit at the end of the list).
- close/error handlers ignore stale events from a superseded process
  (a late close of an old process could reset state of the new one
  started by the queue drain); _killClaudeProcess also cancels
  pending permission requests synchronously so a stale entry can
  never keep _maybeEndClaudeStdin from closing the new stdin.
- [queue] diagnostic logging on enqueue/auto-send/clear.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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