af-agent-runtime
Recoverable Turn/Step loop, tool pipeline, retry and context compaction.
Install
Use the exact Agent Factory version across packages in one application.
Scope
This package owns reusable, business-free infrastructure and lifecycle contracts. Product prompts, domain tools, policies, credentials, data, and deployment configuration remain in the consuming application.
Image request policy
RuntimeLimits.max_images defaults to eight. Each request keeps the latest user
input's images and fills remaining capacity from recent history. Current input
above the limit is rejected; event history is unchanged. Compaction and recovery
retain current stable image references. Custom Compactor implementations now
receive a CompletionRequest, including caller context for image authorization.
Documentation
API and package documentation: https://docs.rs/af-agent-runtime
A durable TurnRequest now takes RunHistory, bound to the target Run.
RunHistoryReplay folds complete lifecycle/usage facts in pages, then consumes
only the model tail after the latest successful compaction. Failed or unfinished
summaries preserve the original transcript. Current image IDs survive the
summary; historical execution facts remain available for recovery and settlement.
For a small in-memory log use RunHistory::from_events(run_id, &events).
Persistent callers should use AgentStore::load_run_history so both passes use
bounded reads at one captured upper sequence. This is an in-memory replay result,
not a new persisted checkpoint or alternate runtime.