Lane Queue

A session has no queue unless you create it with queueConfig / queue_config / QueueConfig. With a queue, host-direct tool calls (session.tool(...) and the typed helpers such as bash, readFile, and grep) are scheduled on lanes, each with its own concurrency limit. Tool calls the model makes inside a send or stream turn run directly and do not pass through the queue.

The four lanes are control, query, execute, and generate, with default concurrency limits of 2, 4, 2, and 1. Tools map to lanes by name: read, ls, search (behind grep and glob), web_fetch, web_search, and the code-intelligence tools use query; every other tool uses execute. No tool maps to control or generate.

Rust
Node.js
Python
Go

Notes:

  • hasQueue() / has_queue() / HasQueue() returns true only when the session was created with a queue config. Without one, setting a lane handler does nothing and the queue stats stay at zero.
  • Each lane has a handler mode: internal (the default) runs the tool in process, external parks the call as an external task until your host completes it, and hybrid runs the tool in process and only emits pending and completed notifications. Set it with setLaneHandler / set_lane_handler / SetLaneHandler, or up front in the queue config. External Tasks shows the full drain-and-complete flow.
  • Queue stats report total_pending, total_active, and external_pending (totalPending, totalActive, and externalPending in Node). Rust, Python, and Go also include per-lane status under lanes.
  • In Node, hasQueue is synchronous and the other queue methods return promises. Python queue methods are synchronous. Go queue methods take the caller's context.Context.