Skip to main content

InProcessTurnExecutor

Defined in the protocols module.
AI Agent Default turn executor — today’s on-loop behaviour, no isolation. Zero-cost, dependency-free implementation of :class:TurnExecutorProtocol for single-process deployments. It runs each turn directly on the current event loop exactly as the gateway does today, so selecting it (or leaving the executor unset) is byte-for-byte backward compatible and introduces no dependency. It provides no blast-radius isolation: a turn that wedges the loop still affects the process — choosing an isolated executor (subprocess / container / remote, in the wrapper) is what contains a bad turn to its own worker. All turns share one worker (the current process/loop), so every placement carries the same constant worker_id at epoch 0, and teardown is inert — an in-process turn is cancelled through the existing cancel_token when the holding task exits, so there is no worker to reclaim. The limits argument is accepted for protocol symmetry but is inert here (no separate worker to bound).

Methods

place()

Instance method.

execute_turn()

Instance method.

teardown()

Instance method.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 5729