Documentation Index
Fetch the complete documentation index at: https://kawax.biz/llms.txt
Use this file to discover all available pages before exploring further.
Steering and queuing
In normal Laravel application flows, you usually do not use steering directly.
This is mainly an internal SDK-level capability and is harder to benefit from in synchronous Laravel patterns.
Overview
All ofsend(), sendAndWait(), sendAndStream(), and Copilot::run() have a $mode parameter.
| Mode | Behavior |
|---|---|
"enqueue" (default) | Processed as queued work after the current turn completes |
"immediate" (steering) | Injected immediately into the turn currently in progress |
Steering ("immediate")
This injects a message directly into the turn the agent is currently processing.
The agent receives it in real time and adjusts the response.
Use this when you want to correct direction without interrupting ongoing work.
Queuing ("enqueue")
This adds messages to a queue and processes them in order after the current turn completes.
Each queued message runs as an independent turn.
This is the default behavior when $mode is omitted.
Practical perspective in Laravel
In Laravel, synchronous patterns withCopilot::run() and sendAndWait() are common.
These send a message and wait until idle, so there is no practical chance to interrupt while the agent is processing, and $mode is effectively irrelevant.
"immediate") is useful when you send messages asynchronously with send() and can intervene in an in-progress turn using another message.
In Laravel’s synchronous flow, creating that opportunity is difficult, so it is usually best to keep the default mode and avoid specifying $mode.
Which should you use?
| Situation | Pattern |
|---|---|
| The agent is going in the wrong direction | Steering ("immediate") |
| You thought of the next task | Queuing ("enqueue") |
| You want to run multiple tasks in order | Queuing ("enqueue") |
| Typical Laravel app | Default ($mode not needed) |
Best practices
- Default to queuing — Omitting
$mode(or using"enqueue") is appropriate in most cases. It gives predictable behavior. - Use steering for correction — Use
"immediate"only when the agent is clearly doing the wrong thing. - Keep steering messages concise — Use short messages understandable in the current context. Long and complex steering messages can cause confusion.
- Avoid repeated steering bursts — Sending multiple steering messages in a short time can degrade turn quality. For major direction changes, it may be better to stop the turn and restart.
See also
For the latest updates, see the GitHub repository.