Expand description
Core agent execution spawning logic.
Provides spawn_session_execution which handles the full lifecycle of a
background agent run: spawn task → execute → finalize runner → persist session.
Re-exports§
pub use crate::session_cache::SessionCache;
Structs§
- Session
Execution Args - Arguments for spawning a background agent execution.
- Session
Execution Outcome - Outcome of an agent execution, handed to an optional
SessionCompletionHook. - Session
Execution Reservation - One exact runner reservation plus its logical-session activation ownership.
- Session
Preparation Reservation - A fenced history preparation, deliberately unable to spawn an execution. Its private logical owner never installs or retires a shared runner.
Enums§
- Session
Execution Reserve Outcome - Combined runner/router reservation result.
Functions§
- log_
base_ system_ prompt_ snapshot - Log a snapshot of the base system prompt for debugging.
- read_
cached_ session - Read a consistent session snapshot without acquiring a session or index
lock. Returns
Noneon a cache miss. - reserve_
selected_ input_ execution - Selected Native input activation uses the same reservation protocol, while its release only inherits explicitly requested producer wakeups.
- reserve_
session_ execution - Reserve the shared runner slot and logical-session router as one handoff.
- reserve_
session_ preparation - Acquire only logical ownership for a durable preparation. A following real execution, not this operation, decides when to replace retained output.
- spawn_
session_ execution - Spawn a background agent execution task.
- spawn_
session_ execution_ with_ inputs - Forward only explicitly supplied caller data through the existing spawned body. The reservation and public argument layout remain unchanged.
- spawn_
session_ execution_ with_ upstream_ retry - An explicit per-execution initial-request retry option. Existing admission, reservation, cancellation, messages and completion ownership are unchanged.
- terminal_
error_ event_ for_ result - Map an execution result to a terminal error event.
Type Aliases§
- Session
Completion Hook - Optional post-execution hook for
spawn_session_execution.