Lane Queue

By default A3S Code runs every task in-process, with no queue. The lane queue is optional infrastructure: register an external handler for a lane and the tools routed to that lane are queued for an outside worker instead of being executed by the agent. You then drain the pending tasks, run them however you like, and report results back. Reach for this only when an external worker is genuinely part of your architecture.

The four lanes are control, query, execute, and generate. Each handler has a mode of internal (the default), external, or hybrid.

Node.js
Python

Notes:

  • The default path is queue-free. hasQueue() / has_queue() returns false until you register at least one external (or hybrid) lane handler. If you never call setLaneHandler / set_lane_handler, every task runs in-process and there is nothing to drain.
  • Each pending task carries task_id, session_id, lane, command_type, payload, and timeout_ms. Pass the task_id back to completeExternalTask / complete_external_task once the work is done.
  • The result shape is { success, result?, error? }result holds any JSON-serializable payload, and error is an optional message for failures. completeExternalTask / complete_external_task returns true if the task was found and completed, false otherwise.
  • In Python these queue methods are synchronous; in Node setLaneHandler, pendingExternalTasks, and completeExternalTask return promises, while hasQueue is synchronous.