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.
Notes:
hasQueue()/has_queue()/HasQueue()returnstrueonly 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,externalparks the call as an external task until your host completes it, andhybridruns the tool in process and only emits pending and completed notifications. Set it withsetLaneHandler/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, andexternal_pending(totalPending,totalActive, andexternalPendingin Node). Rust, Python, and Go also include per-lane status underlanes. - In Node,
hasQueueis synchronous and the other queue methods return promises. Python queue methods are synchronous. Go queue methods take the caller'scontext.Context.