feat(sessions): Add steer and queue messaging modes#2663
Open
charlesvien wants to merge 3 commits into
Open
Conversation
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Complex feature touching agent mid-turn injection, session lifecycle state, and API contracts with zero reviews. The implementation looks architecturally sound, but the behavioral changes to core agent message handling warrant a human reviewer sign-off before auto-approval.
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/ui/src/features/sessions/hooks/useToggleMessagingMode.ts:29-35
**Queued messages silently dropped on flush error**
`void sessionService.sendPrompt(...)` discards any rejection, so if the session becomes unavailable mid-flush (session ends, network drop, `addDirectoryDialog` open) the messages are permanently lost with no user feedback. The messages were already dequeued before the sends, so there is no recovery path. Wrapping each call in a try/catch — or collecting the promises and surfacing a toast on failure — would prevent silent data loss.
### Issue 2 of 2
packages/ui/src/features/sessions/messagingModeStore.ts:14-27
**`modesByTaskId` grows indefinitely**
Every `setMode` call adds an entry keyed by `taskId` and the store is persisted to disk. There is no eviction — a user with many historical tasks will accumulate stale entries that are never read again. Adding a `clearMode(taskId)` action and calling it when a task is deleted (or sessions are cleaned up) would keep the persisted payload bounded.
Reviews (1): Last reviewed commit: "add steer and queue messaging modes" | Re-trigger Greptile |
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.
Problem
Messages sent while the agent was working could only queue until the turn finished, so there was no way to steer a run already in progress.
Closes #1056
Changes
mod+sshortcut and a "Default messaging mode" setting in General settingspriority: "next")steerthrough the agent prompt router, schema and workspace-serverHow did you test this?
Manually
Automatic notifications