The per-turn I/O wiring half of ResolvedAgentExecution::resolve’s input:
the borrowed sinks, channels, and policy handles a path holds for the turn.
A grouped input layer (not stored state); resolve spreads it into the bundle.
The resolved model binding: which provider, model, and temperature a turn
uses. The base layer any LLM call needs; ResolvedAgentExecution composes
it. Field names mirror the engine’s former flat fields so the loop body is
unchanged after destructuring.
The resolved per-agent runtime knobs half of ResolvedAgentExecution::resolve’s
input: the values derived from the agent’s resolved config. A grouped input layer
(not stored state); resolve spreads it into the bundle.
Config handle the live SOP driver needs to re-assemble a nested step’s agent
when the step delegates to a different agent than the one running the turn.
Execute a single turn of the agent loop: send messages, parse tool calls,
execute tools, and loop until the LLM produces a final text response.
When silent is true, suppresses stdout (for channel use).
agent_alias, when the caller has resolved one, is threaded onto the
turn’s AgentStart/AgentEnd brackets and onto the inner ToolLoop, so
every lifecycle observer event of the turn (agent_start, llm_request,
llm_response, tool_call_start, tool_call, agent_end) carries the full
(channel, agent_alias, turn_id) correlation triple that observer
consumers (Prometheus, OTel, the gateway /api/events stream) rely on for
per-agent attribution. None opts out for callers without a resolved
alias (tests, benches). turn_id follows the same pattern: Some reuses
a caller-minted id so pre-turn events (the process_message RAG
retrieval) join the bracket; None self-mints.
Whether an MCP tool name is admitted by policy (a None policy admits
everything). The risk-profile denylist always wins; the allowlist
auto-admits <server>__<tool> names so a restrictive allowlist does not
silently drop a configured server’s tools.
Public helper for other crates (e.g. channels orchestrator) to load
peripheral tools through the registered factory. Returns empty vec
when nothing is registered (hardware feature off or not yet wired).
Build the MCP tool-access policy for an agent from its SecurityPolicy
(allowed_tools + excluded_tools) and an optional caller-supplied
allowlist. Shared by the runtime agent loop and the channels orchestrator
so every MCP registration site gates through identical logic.
Process a single message through the full agent (with tools, peripherals, memory).
Used by channels (Telegram, Discord, etc.) to enable hardware and tool use.
Register an eager MCP tool wrapper into tools (and the delegate handle,
when present) only if policy admits it. Returns true when the tool was
registered, false when the policy dropped it.
Run a future with the session key set in task-local storage.
The scope wraps the entire agent turn, so all tools invoked during
the turn (including nested calls) see the same session key.
SessionsCurrentTool reads this to identify the active session.
Remove <think>...</think> blocks from model output.
Qwen and other reasoning models embed chain-of-thought inline in the
response text using <think> tags. These must be removed before parsing
tool-call tags or displaying output.
Callback type for checking if model has been switched during tool execution.
Returns Some((model_provider, model)) if a switch was requested, None otherwise.