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
| Concern | Type |
|---|---|
| Fatal loop failure | AgentError — returned from AgentLoopPort::run |
| Executor infrastructure failure | anyhow::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§
- Agent
RunOutput - Output returned by a successful
AgentLoopPort::runinvocation.
Enums§
- Agent
Error - Errors that terminate the agentic loop.
Traits§
- Agent
Loop Port - Port: drives the full backend agentic loop.
- Tool
Executor Port - Port: dispatches tool calls to the underlying execution backend.