pub struct InferenceContext<'a> {Show 16 fields
pub project_root: &'a Path,
pub config: &'a KodaConfig,
pub db: &'a Database,
pub session_id: &'a str,
pub system_prompt: &'a str,
pub provider: &'a dyn LlmProvider,
pub tools: &'a ToolRegistry,
pub tool_defs: &'a [ToolDefinition],
pub pending_images: Option<Vec<ImageData>>,
pub mode: TrustMode,
pub sink: &'a dyn EngineSink,
pub cancel: CancellationToken,
pub cmd_rx: &'a mut Receiver<EngineCommand>,
pub file_tracker: &'a mut FileTracker,
pub bg_agents: &'a Arc<BgAgentRegistry>,
pub sub_agent_cache: &'a SubAgentCache,
}Expand description
All parameters for the inference loop, bundled into a single struct.
Fields§
§project_root: &'a PathProject root directory.
config: &'a KodaConfigGlobal configuration.
db: &'a DatabaseDatabase handle for message persistence.
session_id: &'a strCurrent session identifier.
system_prompt: &'a strSystem prompt for this session.
provider: &'a dyn LlmProviderLLM provider to use.
tools: &'a ToolRegistryTool registry with all available tools.
tool_defs: &'a [ToolDefinition]Pre-computed tool definitions sent to the LLM.
pending_images: Option<Vec<ImageData>>Images attached to the current prompt (consumed on first turn).
mode: TrustModeCurrent trust mode.
sink: &'a dyn EngineSinkEvent sink for streaming output to the client.
cancel: CancellationTokenCancellation token for graceful interruption.
cmd_rx: &'a mut Receiver<EngineCommand>Channel for receiving client commands (approval responses, etc.).
file_tracker: &'a mut FileTrackerFile lifecycle tracker for ownership-aware approval (#465).
bg_agents: &'a Arc<BgAgentRegistry>Background sub-agent registry (#1022 B12). Owned by crate::session::KodaSession
so bg agents survive across turns; this is just a borrow into
the loop. Drained at the top of every iteration to inject
completed bg results into the conversation.
sub_agent_cache: &'a SubAgentCacheCross-turn sub-agent result cache (#1022 B12). Owned by crate::session::KodaSession.
Generation-based invalidation on mutating tool calls is
honored uniformly via crate::tool_dispatch::execute_one_tool.
Auto Trait Implementations§
impl<'a> Freeze for InferenceContext<'a>
impl<'a> !RefUnwindSafe for InferenceContext<'a>
impl<'a> Send for InferenceContext<'a>
impl<'a> Sync for InferenceContext<'a>
impl<'a> Unpin for InferenceContext<'a>
impl<'a> UnsafeUnpin for InferenceContext<'a>
impl<'a> !UnwindSafe for InferenceContext<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more