-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: Add message queue system with interruption handling #4179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add MessageQueue component with drag-and-drop reordering - Add interruption detection for natural language commands - Add queue pause/resume functionality with visual indicators - Add InterruptionHandler component for managing interruptions - Add Pill UI component for status display - Add queueStorage utility for persistence - Integrate queue system into ChatInput with keyboard shortcuts - Support for editing queued messages and priority sending Addresses #4179
24bcb5f to
816b205
Compare
- Fix queue auto-resume to only trigger on non-interruption messages - Add intelligent queue resume logic to handleStopAndSend function - Ensure interruption commands (wait, stop, etc.) keep queue paused until user sends regular message - Queue now properly resumes when user sends message via chat input or queue - Maintain existing manual pause/resume functionality Fixes queue behavior for PR #4179
- Clear paused state and interruption when adding message to empty queue - Clear paused state and interruption when queue becomes empty after processing - Ensures fresh queue state when starting new queue sessions - Prevents stale pause state from previous queue sessions Fixes edge case where empty queue could remain paused from previous session
- Remove queue pausing logic from handleStopAndSend function - Send Now should interrupt current processing and send message immediately - Queue automatically continues processing remaining messages after Send Now completes - Only pause queue when user explicitly uses pause words or stop button - Maintains priority sending without disrupting queue flow Fixes Send Now behavior to be non-disruptive to queue processing
- Temporarily pause queue during Send Now operation to prevent race condition - Save previous pause state and restore it after brief delay - Prevents queue processing effect from triggering while Send Now is executing - Ensures only the selected message is sent, not additional queue messages Fixes double-send issue where Send Now would trigger both the selected message and queue processing
- Initialize queue state from localStorage on component mount - Save queue messages, pause state, and interruption state to localStorage - Restore queue state when navigating between pages or restarting app - Update all queue operations to sync with storage (add, remove, edit, reorder, clear) - Add cleanup effect to save final state on component unmount - Queue now persists across navigation and continues processing where it left off Ensures queue functionality works seamlessly across different spaces and app sessions
- Change QueueStorage utility to use sessionStorage instead of localStorage - Change queue state storage (paused/interrupted) to use sessionStorage - Queue now persists during page navigation within same session - Queue automatically clears on app reload/restart - Maintains queue functionality during navigation while preventing stale queues Fixes queue behavior to clear on app reload but persist during navigation
- Integrate intelligent message queue with interruption handling - Add queue persistence across page navigation using sessionStorage - Implement message reordering, editing, and priority sending - Add interruption detection for stop/pause/redirect commands - Include MessageQueue, InterruptionHandler components and supporting utilities - Enhance ChatInput with queue management and interruption logic - Queue automatically processes messages when AI is idle - Support for manual queue control (pause/resume/clear) Combines sophisticated animated background (PR #4168) with advanced message queue functionality (PR #4179)
- Remove all duplicate unused function declarations in ChatInput.tsx - Remove unused import getInterruptionMessage from InterruptionHandler.tsx - Clean up code structure to eliminate all TS6133 errors - Functions are now properly declared once and used consistently All queue-related lint errors have been resolved for PR #4179.
- Replace sessionStorage with window.sessionStorage for proper browser API access - Resolves TypeScript compilation errors in queue persistence functionality
- Replace all sessionStorage with window.sessionStorage for proper browser API access - Fix React Hook dependency warning by including lastInterruption in useEffect deps - Resolves all TypeScript compilation errors in queue persistence functionality
* 'main' of github.com:block/goose: Remove unused extension stuff (#4166) Added tests for extensions functionality (#3794) chore(release): release version 1.5.0 (#4169) Fix tests from upstream changes and add testing to lint staged and ci (#4127) Unlist figma tutorial (#4186) feat(ui): Implement in-place message editing with re-response (#3798)
|
@zanesq @spencrmartin I think this is ready for review, I really liked what I saw when I tested it out by hand. added some unit tests, but it is a bit of a chunky set of additions to |
* main: docs: add figma tutorial (#4231) Add Nix flake for reproducible builds (#4213) Enhanced onboarding page visual design (#4156) feat: adds mtls to all providers (#2794) (#2799) Don't show a confirm dialog for quitting (#4225) Fix: Missing smart_approve in CLI /mode help text and error message (#4132) Clean up langfuse docs and scripts (#4220) feat: add remark-breaks plugin to preserve single newlines in markdown (#4217) feat(mcp/developer): accept -1 for insert_line number (#4112) Remove dead code and old settings migration (#4180) removed tests from lint-staged (#4203) docs: openrouter and ollama easy desktop setup (#4195) Custom providers update (#4099) docs: goose_terminal env var (#4205) Desktop alerts when suspicious unicode characters found in Recipe (#4080) chore: remove the google drive built-in extension (#4187) Move out app init (#4185)
|
tagging @alexhayes-block who may be interested to follow along - with this in future could be a place to hang session forking (ie if you go back to change something) |
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, this seems solid, I did some minor refactoring to reduce duplication and the size of the change, so would love a @zanesq or @DOsinga stamp to be sure (otherwise can merge it in) - really really nice. I love being able to halt things and queue them up and it is visually obvious. A great start on this important feature.
|
I noticed a bug where sending the chat command "Stop" isn't fully stopping it from continuing the task. Try running the tamogotchi game example from a fresh chat in home then as its running send "Stop" and it appears to recognize that and try to stop but then it continues on after that and the stop message disappears from the chat history. |
|
@zanesq will take a look - I wonder if that is goose unable to kill the task vs this code? |
|
@michaelneale maybe not a blocker for this PR since its a hidden feature anyway but it was added here so was testing it |
|
Lemme know if you two want to pull this back - we can otherwise we can fire it out to something like an internal team to test or pull tha trigga! @michaelneale @zanesq |
* main: docs: update View/Edit Recipe menu item name (#4267) Remove unused game (#4226) fix issue where app redirects to home after initialization but user has already started a chat (#4260) Feat: Let providers configure a fast model for summarization (#4228) docs: update tool selection strategy (#4258) feat: upgrade `@mcp-ui/client` package and improve UI message handling (#4164) stop replacing chat window when changing working directory (#4200) Only fetch session tokens when chat state is idle to avoid resetting during streaming (#4104) bump timeouts for e2e tests (#4251) docs: custom context files improvements (#4096) chore: upgrade rmcp to 0.6.0 (#4243) doc: uvx not npx (#4240) Add PKCE support for Tetrate Agent Router Service (#4165) Read AGENTS.md by default (#4232) docs: configure provider and model (#4235)
|
@zanesq yeah I think I am ok with it - seems to stop anything I try, but may be something else, I think can keep an eye on it, and is valuable as is I think. |
* main: (42 commits) feat: Add message queue system with interruption handling (#4179) Start extensions concurrently (#4234) Add X-Title and referer headers on exchange to tetrate (#4250) docs: update View/Edit Recipe menu item name (#4267) Remove unused game (#4226) fix issue where app redirects to home after initialization but user has already started a chat (#4260) Feat: Let providers configure a fast model for summarization (#4228) docs: update tool selection strategy (#4258) feat: upgrade `@mcp-ui/client` package and improve UI message handling (#4164) stop replacing chat window when changing working directory (#4200) Only fetch session tokens when chat state is idle to avoid resetting during streaming (#4104) bump timeouts for e2e tests (#4251) docs: custom context files improvements (#4096) chore: upgrade rmcp to 0.6.0 (#4243) doc: uvx not npx (#4240) Add PKCE support for Tetrate Agent Router Service (#4165) Read AGENTS.md by default (#4232) docs: configure provider and model (#4235) docs: add figma tutorial (#4231) Add Nix flake for reproducible builds (#4213) ...
|
Noting @michaelneale the resume function post a user sending a message after the queue is no longer in. |
* main: (24 commits) feat: autovisualiser of structured data with mcp-ui (#4153) docs: Plan tutorial (#4309) Extensions Modal Improvements (#4293) docs: fixed cicd tutorial pipeline in docs (#4223) Read oltp config from config and env (#4292) release/1.6.0 (#4280) docs: fix broken links in Docker tutorial (#4285) Remove half-second wait, rework auto submit (#4282) Block send until extensions are ready (#4271) fix: improve OpenAI-compatible error handling and add test coverage (#4175) Move To-Do Tool to Session Scope from Agent Scope (#4157) fix: recipe params not being replaced all the time (#4207) chore: removing little-used session sharing feature (#4249) Stop auto scrolling when agent responds and let scroll area handle scrolling to bottom (#4257) restore cli projects from accidental removal during cleanup (#4266) Fix: deep link extension installation to show dialog for headers configuration (#4150) feat: Add message queue system with interruption handling (#4179) Start extensions concurrently (#4234) Add X-Title and referer headers on exchange to tetrate (#4250) docs: update View/Edit Recipe menu item name (#4267) ...
Co-authored-by: Zane Staggs <[email protected]> Co-authored-by: Michael Neale <[email protected]> Signed-off-by: Alex Rosenzweig <[email protected]>
Co-authored-by: Zane Staggs <[email protected]> Co-authored-by: Michael Neale <[email protected]> Signed-off-by: Dorien Koelemeijer <[email protected]>
migrated over from: #4081 - (can see some discussion there).
and with halt rules:
This commit implements a comprehensive message queuing system for ChatInput that allows users to queue messages while the chat is processing responses.
New Features:
New Components:
Modified Components:
Technical Implementation:
based on prework by #4081