Skip to main content

spawn_provider

Function spawn_provider 

Source
pub async fn spawn_provider(
    provider_id: &str,
    command: &[String],
) -> Result<(RemoteModelProvider, Child), Box<dyn Error + Send + Sync>>
Expand description

Spawn a provider process and wait for it to print its socket path on stdout. The returned Child kills the process when dropped; callers must keep it alive for as long as the provider is in use.

The child gets a null stdin and piped stdout/stderr — never the daemon’s own handles, which can be closed pipes when the daemon was auto-launched in the background. Everything the provider prints (beyond the initial socket path line) is forwarded to the daemon’s log.