Module runtime

Module runtime 

Source

Re-exports§

pub use loop_runner::ResolvedRun;

Modules§

activity
Activity state manager and event emission.
control
Loop runtime state aliases.
loop_runner
Agent loop implementation with Phase-based plugin execution.
run_context
streaming
Streaming response handling for LLM responses.

Structs§

AgentOs
BackgroundCapable
Wraps a tool that implements BackgroundExecutable to provide full task lifecycle management:
BackgroundTaskManager
Thread-scoped background task manager.
BackgroundTaskView
Lightweight derived projection for prompt injection and UI summaries on the owner thread. This is a cache, not the source of truth.
BackgroundTaskViewState
Lightweight cached task view stored on the owner thread for prompt injection. The canonical task state remains in the task thread.
BackgroundTasksPlugin
Behavior that keeps a lightweight owner-thread task projection in sync and injects reminders about active background tasks.
ConsecutiveErrors
Stop after N consecutive rounds where all tool executions failed.
ContentMatch
Stop when LLM output text contains a literal pattern.
ContextPlugin
Unified context plugin: logical compression + hard truncation + prompt caching.
ForwardedDecision
LoopDetection
Stop when the same tool call pattern repeats within a sliding window.
MaxRounds
Stop after a fixed number of tool-call rounds.
NewTaskSpec
PreparedRun
Fully prepared run payload ready for execution.
RunStream
Result of AgentOs::run_stream: an event stream plus metadata.
StopOnTool
Stop when a specific tool is called by the LLM.
StopPolicyInput
Canonical stop-policy input.
StopPolicyPlugin
Plugin adapter that evaluates configured stop policies at AfterInference.
StopPolicyStats
Aggregated runtime stats consumed by stop policies.
TaskCancelTool
Cancel a running background task and any descendant tasks.
TaskOutputTool
Read the output of a background task.
TaskState
Durable task state stored inside a dedicated task thread (task:<task_id>).
TaskStatusTool
Query background task status and result.
TaskStore
TaskSummary
Summary of a background task visible to tools and plugins.
Timeout
Stop after a wall-clock duration elapses.
TokenBudget
Stop when cumulative token usage exceeds a budget.

Enums§

AgentOsResolveError
AgentOsRunError
BackgroundTaskViewAction
TaskAction
Reducer actions for durable task state.
TaskResult
Result produced by a background task on completion.
TaskResultRef
Durable reference to task output stored elsewhere.
TaskStatus
Status of a background task.
TaskStoreError

Constants§

BACKGROUND_TASKS_PLUGIN_ID
CONTEXT_PLUGIN_ID
Behavior ID used for registration.
TASK_CANCEL_TOOL_ID
TASK_OUTPUT_TOOL_ID
TASK_STATUS_TOOL_ID

Traits§

BackgroundExecutable
Context-free background execution trait.
StopPolicy
Stop-policy contract used by super::StopPolicyPlugin.

Functions§

compose_behaviors
Compose multiple behaviors into a single AgentBehavior.

Type Aliases§

TaskId
Unique identifier for a background task.