Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ tokio.workspace = true
tokio-stream.workspace = true

[dev-dependencies]
bytes.workspace = true
exoharness = { path = "../exoharness", features = ["basic-backend"] }
futures.workspace = true
tempfile = "3.23.0"
Expand Down
12 changes: 7 additions & 5 deletions crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use clap::{Parser, Subcommand, ValueEnum};
use executor::{
AgentHarnessKind, BasicExoHarness, BasicExoHarnessConfig, BasicHarness, Binding,
BraintrustProject, BraintrustRuntimeConfig, BraintrustTracingConfig, ConversationModelConfig,
CreateAgentRequest, CreateConversationRequest, EventKind, EventQuery, EventQueryDirection,
ExoHarness, FileSystemMount, FileSystemMountMode, ForkConversationRequest, Harness,
HarnessAgent, HarnessConversation, PutSecretRequest, RlmHarness, SANDBOX_MAIN_MOUNT_DIR,
SandboxBackendChoice, Secret, SecretBackendChoice, SendRequest, TypeScriptHarness,
TypeScriptHarnessConfig, Uuid7, load_agent_config,
CreateAgentRequest, CreateConversationRequest, DaytonaConfig, EventKind, EventQuery,
EventQueryDirection, ExoHarness, FileSystemMount, FileSystemMountMode, ForkConversationRequest,
Harness, HarnessAgent, HarnessConversation, PutSecretRequest, RlmHarness,
SANDBOX_MAIN_MOUNT_DIR, SandboxBackendChoice, Secret, SecretBackendChoice, SendRequest,
TypeScriptHarness, TypeScriptHarnessConfig, Uuid7, load_agent_config,
};
use lingua::Message;
use lingua::universal::{AssistantContent, AssistantContentPart, ToolContentPart, UserContent};
Expand Down Expand Up @@ -180,6 +180,7 @@ enum SandboxBackendArg {
Docker,
#[value(name = "local-process")]
LocalProcess,
Daytona,
}

fn build_exo_config(cli: &Cli) -> Result<BasicExoHarnessConfig> {
Expand All @@ -193,6 +194,7 @@ fn build_exo_config(cli: &Cli) -> Result<BasicExoHarnessConfig> {
SandboxBackendArg::AppleContainer => SandboxBackendChoice::AppleContainer,
SandboxBackendArg::Docker => SandboxBackendChoice::Docker,
SandboxBackendArg::LocalProcess => SandboxBackendChoice::LocalProcess,
SandboxBackendArg::Daytona => SandboxBackendChoice::Daytona(DaytonaConfig::from_env()?),
};
Ok(BasicExoHarnessConfig {
root: cli.root.join("exoharness"),
Expand Down
33 changes: 11 additions & 22 deletions crates/cli/src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,28 +660,17 @@ fn print_help() {
/// event, returning the sandbox id. Returns `None` if no sandbox has been
/// created yet (e.g. nothing has been chatted with).
async fn latest_sandbox_id(conversation: &dyn HarnessConversation) -> Result<Option<SandboxId>> {
let result = conversation
.exoharness_handle()
.get_events(Some(EventQuery {
cursor: None,
direction: Some(EventQueryDirection::Desc),
limit: Some(1),
session_id: None,
turn_id: None,
types: Some(vec![EventKind::SANDBOX_CREATED]),
}))
.await?;
let Some(event) = result.events.into_iter().next() else {
return Ok(None);
};
match event.data {
EventData::SandboxCreated { sandbox_id, .. } => Ok(Some(sandbox_id)),
other => anyhow::bail!(
"type-filtered query for {} returned unexpected variant {}",
EventKind::SANDBOX_CREATED.as_str(),
other.kind().as_str(),
),
}
executor::first_matching_event(
conversation.exoharness_handle().as_ref(),
EventKind::SANDBOX_CREATED,
EventQueryDirection::Desc,
1,
|data| match data {
EventData::SandboxCreated { sandbox_id, .. } => Some(sandbox_id),
_ => None,
},
)
.await
}

/// All snapshots taken in the conversation, oldest-first. Each tuple is
Expand Down
Loading