Enqueue and steer
Choose when a new message affects a running session.
enqueue waits for the current turn. steer adds input at the next model step and
supersedes pending approvals. Both start work immediately when the session is idle.
await client.sessions.send({ id, message: "One more question." })
await client.sessions.send({ id, message: "Stop: that is the wrong account.", mode: "steer" })Enqueue, the default
Queued messages wait until the current turn finishes. Multiple waiting messages start one new turn together, in sequence order. They do not change a pending approval; answer it before the session can continue.
Steer
Steering adds the message at the next step boundary. It does not stop a tool already running. Use it to correct or redirect current work, and expect any pending approvals to be superseded. Use interrupt to stop the turn.
Both delivery modes survive a restart. The saved session state records which inputs belong to the current turn and which are waiting.
Sub-agents
sys_message_subagent uses the same mode and defaults to enqueue. Reports from
a child reach the parent at its next step, or start a turn if the parent is idle.
Sending exactly once
await client.sessions.send({ id, message, idempotencyKey: requestId })Reuse the same key when retrying one logical send. A duplicate returns the original event and does not start a second turn. Send keys are unique within a session; creation keys are unique within an environment.