pub struct SubprocessRuntime {
pub broker: AnyBroker,
pub shutdown: CancellationToken,
pub config_dir: PathBuf,
pub state_root: PathBuf,
pub long_term_memory: Option<Arc<LongTermMemory>>,
pub llm_registry: Arc<LlmRegistry>,
pub llm_config: Arc<LlmConfig>,
pub sandbox: Arc<SandboxRunner>,
}Expand description
Runtime handles the caller (main.rs) supplies so the
auto-subprocess fallback in run_plugin_init_loop_with_factory
can build a real PluginInitContext for SubprocessNexoPlugin::init.
Today the subprocess adapter only reads broker + shutdown
from the context. Other registries (tool / advisor / hook /
llm / channel_adapter / sessions / reload_coord) get stub
::new() instances inside wire_plugin_registry’s ctx_factory
because the subprocess path doesn’t touch them. config_dir
state_rootare passed so the SDK’splugin_config_dir(id)helper resolves correctly.
Fields§
§broker: AnyBroker§shutdown: CancellationToken§config_dir: PathBuf§state_root: PathBuf§long_term_memory: Option<Arc<LongTermMemory>>Long-term memory backend exposed to subprocess plugins via
the memory.recall JSON-RPC method. None when the operator
hasn’t configured memory.
llm_registry: Arc<LlmRegistry>Real LLM registry (with operator’s providers registered)
threaded into the subprocess pipeline so llm.complete
requests reach actual providers instead of the
SubprocessCtxStubs empty stub.
llm_config: Arc<LlmConfig>Provider config (api keys, endpoints, retry knobs, tenant
overrides) the registry needs at build() time. Subprocess
plugins issuing llm.complete requests get clients
constructed from this config.
sandbox: Arc<SandboxRunner>Sandbox runner shared across subprocess
plugin spawns. Discovers bwrap once + caches env-driven
capability flags. Used by SubprocessNexoPlugin::spawn_one_attempt
to wrap each plugin’s command with bwrap argv when the
plugin’s manifest declares [plugin.sandbox] enabled = true.
Auto Trait Implementations§
impl !RefUnwindSafe for SubprocessRuntime
impl !UnwindSafe for SubprocessRuntime
impl Freeze for SubprocessRuntime
impl Send for SubprocessRuntime
impl Sync for SubprocessRuntime
impl Unpin for SubprocessRuntime
impl UnsafeUnpin for SubprocessRuntime
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