Module agent

Module agent 

Source
Expand description

Agent loop port traits.

Defines the hexagonal-architecture port interfaces for the backend agentic loop. All types used in signatures are from gglib-core; no adapter- or crate-specific symbols appear here.

§Port hierarchy

AgentLoopPort
  └── uses ──→ ToolExecutorPort  (to dispatch individual tool calls)
  └── emits ──→ Sender<AgentEvent>  (SSE-ready async channel)

§Error separation

ConcernType
Fatal loop failureAgentError — returned from AgentLoopPort::run
Executor infrastructure failureanyhow::Error — from ToolExecutorPort::execute
Tool-level outcome (incl. failures)ToolResult::success field — LLM context

A tool result with success: false is not an error; it is fed back into the conversation so the model can observe and react to the failure. AgentError is reserved for conditions where the loop itself cannot continue.

Structs§

AgentRunOutput
Output returned by a successful AgentLoopPort::run invocation.

Enums§

AgentError
Errors that terminate the agentic loop.

Traits§

AgentLoopPort
Port: drives the full backend agentic loop.
ToolExecutorPort
Port: dispatches tool calls to the underlying execution backend.