orxtra v0.13.0 /worker.src.orxtra.worker._pipeline_split
On this page

Splits the 7-step tool pipeline between brain and worker: wrap_tool_for_remote handles scheduler checks, secret substitution/scrubbing, and tracing on the brain; the worker only executes.

#worker.src.orxtra.worker._pipeline_split

#worker.src.orxtra.worker._pipeline_split

Pipeline split for remote tool execution.

The local pipeline (tool/_pipeline.py) runs all 7 steps in-process. For remote execution, steps are split between brain and worker:

Brain: scheduler_check, secret substitution, send to worker, secret scrubbing, mutation recording, trace callback. Worker: actual tool execution (with transient retry).

The brain never retries -- if the worker returns an error, it is real.

#wrap_tool_for_remote

python
def wrap_tool_for_remote(tool: Tool, send_to_worker_fn: Callable[[ExecuteToolCall], Awaitable[ToolCallResult]], secret_registry: SecretRegistry | None, scheduler_check: Callable[[str], UUID], trace_callback: Callable[..., Any] | None, mutation_tracker: dict[str, set[str]] | None, session_id: str, is_start_task: bool=False) -> Tool

Wrap a tool so it executes remotely on a worker.

Returns a new Tool with the same schema but an execute function that routes through the brain-worker protocol.

#wrap_tools_for_remote

python
def wrap_tools_for_remote(tools: list[Tool], send_to_worker_fn: Callable[[ExecuteToolCall], Awaitable[ToolCallResult]], secret_registry: SecretRegistry | None, scheduler_check: Callable[[str], UUID], trace_callback: Callable[..., Any] | None, mutation_tracker: dict[str, set[str]] | None, session_id: str) -> list[Tool]

Wrap all tools for remote execution on a worker.

#should_route_to_worker

python
def should_route_to_worker(tool_location: ToolLocation, execution_target: str | None) -> bool

Decide whether a tool call should be sent to a worker.

Returns True only when the task has an execution target set AND the tool's location allows remote execution (ANYWHERE). LOCAL tools always run on the brain regardless of target.

Search