Skip to main content

Module agent_turn_handler

Module agent_turn_handler 

Source
Expand description

Agent-turn handler — bridges the DAG executor to the chat/inference layer.

This is the final piece of the critical path: R1 → R5 → R3 → R6 → R7 → agent_turn_handler

When a user sends @researcher analyze this data, the chat layer:

  1. Parses the @mention (R7) → resolves to a roster agent.
  2. If the agent has a DAG pipeline definition, the agent-turn handler executes the pipeline using the DAG executor (R3), with each node dispatched as a local LLM agent turn.
  3. If no DAG is defined, falls through to the standard single-agent inference path (run_chat_inference_for_agent).

The handler implements NodeExecutor so the DAG executor can call it for each node. Each node execution is a local LLM inference turn with the node’s inputs (from the blackboard) injected into the prompt context.

Structs§

AgentTurnConfig
Configuration for an agent-turn handler invocation.
AgentTurnExecutor
A node executor that dispatches each DAG node as a local LLM agent turn.

Enums§

AgentTurnOutcome
Result of an agent-turn handler invocation.

Functions§

execute_agent_turn
Execute an agent turn, optionally through a DAG pipeline.
parse_dag_pipeline
Parse a DAG pipeline from a JSON definition.