Skip to main content

Module engine

Module engine 

Source

Re-exports§

pub use react_loop_guard::NoopGuard;
pub use react_loop_guard::ReactLoopGuard;
pub use crate::types::AgentResult;
pub use auto_continue::AutoContinueMiddleware;
pub use max_turns_nudge::MaxTurnsNudgeConfig;
pub use max_turns_nudge::MaxTurnsNudgeMiddleware;
pub use repeat_tool_limit::RepeatToolLimitConfig;
pub use repeat_tool_limit::RepeatToolLimitMiddleware;

Modules§

auto_continue
max_turns_nudge
react_loop_guard
repeat_tool_limit

Structs§

AgentBuilder
AgentRuntime
AgentSession
Stable identity + rolling state of a single chat thread.
AllowAllApprovalHandler
ApprovalRequest
CompactionOutcome
Successful compaction outcome: what happened plus the messages to install.
ConsecutiveFailureRecovery
Recovery strategy that tracks consecutive failures per tool and stops after a limit.
ContextWindowManager
DefaultPipeline
Default pipeline: ToolPolicy hooks + timeout + output size limit.
DenyAllApprovalHandler
GuardCtx
Guard context information — built by runtime, passed to guard.
InMemorySessionStore
NoticeHandle
Cloneable publish handle for engine-internal notices.
PostLlmCtx
PreLlmCtx
RetryOnError
Continue on tool failure, feeding the error back to the model
SessionId
Unique identifier for an agent session.
SessionManager
StopOnError
Default strategy: stop on tool failure.
ToolEnforcementConfig
ToolEnforcementMiddleware
TurnFactMiddleware
Turn fact summary middleware — injects structured facts from the previous turn’s tool results into the next user message.
TurnToolLimitMiddleware
Middleware that enforces a hard limit on tool calls per turn.
UserMessageCtx

Enums§

ApprovalDecision
CompactionKind
What a successful ContextCompaction::compact actually did to the history. agent-base stays strategy-free: it only relays the kind into the log line, so a nudge append never reads as a compaction and a real replacement always does (issue #33).
GuardDecision
Guard decision — returned by guard, executed by base loop.
QueueMode
Controls how queued messages are drained each turn.
RiskLevel
ToolErrorAction
Action taken by the runtime after a tool execution failure

Traits§

ApprovalHandler
Trait for handling tool approval requests.
ContextCompaction
Trait for inline context compaction within the react loop.
Middleware
SessionStore
Session Persistence Adapter
ToolErrorRecovery
Recovery strategy after a tool execution failure
ToolExecutionPipeline
Pure execution pipeline — cares about how to safely execute a tool.

Functions§

estimate_messages_tokens
Estimate total tokens across a message list using ContextWindowManager::message_tokens.
first_system_prompt
Find the first non-ephemeral System message (the system prompt).