Skip to main content

Module agent_spawn

Module agent_spawn 

Source
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§

SessionExecutionArgs
Arguments for spawning a background agent execution.
SessionExecutionOutcome
Outcome of an agent execution, handed to an optional SessionCompletionHook.
SessionExecutionReservation
One exact runner reservation plus its logical-session activation ownership.
SessionPreparationReservation
A fenced history preparation, deliberately unable to spawn an execution. Its private logical owner never installs or retires a shared runner.

Enums§

SessionExecutionReserveOutcome
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 None on 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§

SessionCompletionHook
Optional post-execution hook for spawn_session_execution.