Skip to content

feat(sessions): Add steer and queue messaging modes#2663

Open
charlesvien wants to merge 3 commits into
mainfrom
feat/steer-queue-messaging
Open

feat(sessions): Add steer and queue messaging modes#2663
charlesvien wants to merge 3 commits into
mainfrom
feat/steer-queue-messaging

Conversation

@charlesvien

@charlesvien charlesvien commented Jun 14, 2026

Copy link
Copy Markdown
Member

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

  • Add a Steer/Queue toggle to the composer, a mod+s shortcut and a "Default messaging mode" setting in General settings
  • Steer Claude local turns natively by folding the message into the running turn at the next tool boundary (priority: "next")
  • Fall back to interrupt-and-resend for Codex and cloud sessions
  • Persist a per-task mode override layered over the global default
  • Skip turn-state bookkeeping for steer messages so the running turn keeps its prompt lifecycle
  • Thread steer through the agent prompt router, schema and workspace-server

How did you test this?

Manually

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@github-actions

github-actions Bot commented Jun 14, 2026

Copy link
Copy Markdown

React Doctor found 1 issue in 1 file · 1 warning.

1 warning

src/features/sessions/components/SessionView.tsx

Reviewed by React Doctor for commit 53945a7.

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jun 14, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 14, 2026
@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix 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

Comment thread packages/ui/src/features/sessions/hooks/useToggleMessagingMode.ts Outdated
Comment thread packages/ui/src/features/sessions/messagingModeStore.ts
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.

Implement mid-turn message injection

1 participant