Skip to main content
User steering lets you redirect the agent mid-execution without aborting. Messages are queued and injected at the next natural breakpoint.

How it works

User types while loading
        |
        v
  messageQueue (state)
  messageQueueRef (ref)
        |
        v  prepareStep calls drainSteering()
  flushBeforeSteering():
    - Commits current assistant progress to messages
    - Appends steering messages after it
    - Resets accumulators (fullText, segments, tool calls)
        |
        v
  Combined text injected into AI messages as:
  { role: "user", content: "IMPORTANT -- ..." }
        |
        v
  Agent processes in next step (fresh accumulators)
1

Queue

User types a message while the agent is busy (loading indicator visible). Message is queued (up to 5 messages, shown in UI with “queued” label). The 6th message is rejected — the queue does not silently drop messages.
2

Drain

At the next prepareStep call (between agent steps), drainSteering() drains all queued messages at once.
3

Flush

Current assistant progress is committed as a completed message, steering messages are appended, and accumulators are reset.
4

Inject

Combined steering text is injected as a user message into the AI conversation.
5

Adjust

Agent sees the steering and adjusts its approach on the next step.

Safety

GuardPurpose
Abort gatesteeringAbortedRef prevents drainSteering from firing after Ctrl+X
Ref syncmessageQueueRef.current = [] set directly in abort handler
Queue capMaximum 5 queued messages (6th rejected, not dropped)
Post-completion drainAfter stream ends, remaining queue auto-submitted as the next message
Plan-awareQueue survives across plan revision/execution continuations

UI

Queued messages appear below the chat with a left rail border and “queued” label. They disappear as they’re consumed by the agent or cleared on abort. See also: Multi-agent dispatch for the parallel agent system that steering messages can redirect.