cli: rename pod command crate to insomnia
This commit is contained in:
@@ -14,7 +14,7 @@ pod-store = { workspace = true }
|
||||
manifest = { workspace = true }
|
||||
protocol = { workspace = true }
|
||||
provider = { workspace = true }
|
||||
pod-command = { workspace = true }
|
||||
insomnia = { workspace = true }
|
||||
pod-registry = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
@@ -14,9 +14,9 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use insomnia::PodRuntimeCommand;
|
||||
use llm_worker::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use manifest::{Permission, ScopeRule};
|
||||
use pod_command::PodRuntimeCommand;
|
||||
use pod_store::{PodActiveSegmentRef, PodMetadata, PodMetadataStore};
|
||||
use protocol::stream::JsonLineReader;
|
||||
use protocol::{Event, PodStatus};
|
||||
@@ -329,10 +329,11 @@ where
|
||||
pod_name: &str,
|
||||
socket_path: &Path,
|
||||
) -> Result<(), PodDiscoveryError> {
|
||||
let pod_command = PodRuntimeCommand::resolve().map_err(PodDiscoveryError::RestoreSpawn)?;
|
||||
let mut command = Command::new(pod_command.program());
|
||||
let runtime_command =
|
||||
PodRuntimeCommand::resolve().map_err(PodDiscoveryError::RestoreSpawn)?;
|
||||
let mut command = Command::new(runtime_command.program());
|
||||
command
|
||||
.args(pod_command.prefix_args())
|
||||
.args(runtime_command.prefix_args())
|
||||
.arg("--pod")
|
||||
.arg(pod_name)
|
||||
.arg("--require-pod-state")
|
||||
|
||||
@@ -12,6 +12,7 @@ use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use insomnia::PodRuntimeCommand;
|
||||
use llm_worker::tool::{Tool, ToolDefinition, ToolError, ToolMeta, ToolOutput};
|
||||
use manifest::{
|
||||
CompactionConfigPartial, FileUploadLimitsPartial, Permission, PermissionConfigPartial,
|
||||
@@ -19,7 +20,6 @@ use manifest::{
|
||||
ProfileRegistrySource, ProfileResolveOptions, ProfileResolver, ProfileSelector, ScopeConfig,
|
||||
ScopeRule, SessionConfigPartial, SharedScope, ToolOutputLimitsPartial, WorkerManifestConfig,
|
||||
};
|
||||
use pod_command::PodRuntimeCommand;
|
||||
use serde::Deserialize;
|
||||
use tokio::net::UnixStream;
|
||||
use tokio::process::Command;
|
||||
@@ -409,7 +409,7 @@ impl SpawnPodTool {
|
||||
spawn_config_json: &str,
|
||||
predicted_socket: &Path,
|
||||
) -> Result<(), ToolError> {
|
||||
let pod_command = PodRuntimeCommand::resolve().map_err(|error| {
|
||||
let runtime_command = PodRuntimeCommand::resolve().map_err(|error| {
|
||||
ToolError::ExecutionFailed(format!("failed to resolve Pod runtime command: {error}"))
|
||||
})?;
|
||||
|
||||
@@ -432,8 +432,8 @@ impl SpawnPodTool {
|
||||
ToolError::ExecutionFailed(format!("open {}: {e}", stderr_path.display()))
|
||||
})?;
|
||||
|
||||
let mut cmd = Command::new(pod_command.program());
|
||||
cmd.args(pod_command.prefix_args())
|
||||
let mut cmd = Command::new(runtime_command.program());
|
||||
cmd.args(runtime_command.prefix_args())
|
||||
.arg("--adopt")
|
||||
.arg("--callback")
|
||||
.arg(&self.callback_socket)
|
||||
@@ -446,7 +446,7 @@ impl SpawnPodTool {
|
||||
.process_group(0);
|
||||
|
||||
let child = cmd.spawn().map_err(|e| {
|
||||
ToolError::ExecutionFailed(format!("failed to spawn `{pod_command}`: {e}"))
|
||||
ToolError::ExecutionFailed(format!("failed to spawn `{runtime_command}`: {e}"))
|
||||
})?;
|
||||
|
||||
// Default `kill_on_drop = false` keeps the process alive after
|
||||
|
||||
@@ -141,7 +141,7 @@ fn accept_one_method(listener: UnixListener) -> tokio::task::JoinHandle<Option<M
|
||||
})
|
||||
}
|
||||
|
||||
fn point_pod_command_at_true() {
|
||||
fn point_runtime_command_at_true() {
|
||||
let path = which_true();
|
||||
unsafe {
|
||||
std::env::set_var("INSOMNIA_POD_COMMAND", &path);
|
||||
@@ -224,7 +224,7 @@ async fn spawn_pod_delegates_scope_and_sends_run() {
|
||||
let allow_root = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
let (_predicted_socket, listener) = bind_mock_pod_socket(&runtime_base, "child").await;
|
||||
let received = accept_one_method(listener);
|
||||
@@ -317,7 +317,7 @@ async fn spawn_pod_rejects_scope_outside_spawner() {
|
||||
let outside = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
let registry = SpawnedPodRegistry::new(spawner_rd);
|
||||
let spawner_scope = shared_scope_for(allow_root.path());
|
||||
@@ -379,7 +379,7 @@ async fn spawn_pod_rolls_back_reservation_when_socket_never_appears() {
|
||||
let allow_root = TempDir::new().unwrap();
|
||||
let (_tmp, runtime_base, spawner_socket, spawner_rd) =
|
||||
setup_spawner("root", allow_root.path()).await;
|
||||
point_pod_command_at_true();
|
||||
point_runtime_command_at_true();
|
||||
|
||||
// Deliberately do NOT bind a socket at the predicted path. The
|
||||
// tool's wait_for_socket should time out, triggering rollback.
|
||||
|
||||
Reference in New Issue
Block a user