Bump daytona-sdk-rust and remove exec_command env workaround

The upstream SDK now passes env vars through ExecuteRequest.envs,
so we no longer need to prepend export statements to commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bryan Helmkamp 2026-03-08 00:12:50 -05:00
parent 3748fea9d5
commit 8dffe80527
3 changed files with 6 additions and 26 deletions

6
Cargo.lock generated
View file

@ -1170,7 +1170,7 @@ checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea"
[[package]]
name = "daytona-api-client"
version = "0.1.0"
source = "git+https://github.com/brynary/daytona-sdk-rust#31f01e80875f615bb9e26fe6f857df2465ae6b56"
source = "git+https://github.com/brynary/daytona-sdk-rust?rev=be9adf6#be9adf69438c1c704af56c82c54afa6cefa6efae"
dependencies = [
"reqwest 0.12.28",
"reqwest-middleware",
@ -1184,7 +1184,7 @@ dependencies = [
[[package]]
name = "daytona-sdk"
version = "0.1.0"
source = "git+https://github.com/brynary/daytona-sdk-rust#31f01e80875f615bb9e26fe6f857df2465ae6b56"
source = "git+https://github.com/brynary/daytona-sdk-rust?rev=be9adf6#be9adf69438c1c704af56c82c54afa6cefa6efae"
dependencies = [
"daytona-api-client",
"daytona-toolbox-client",
@ -1203,7 +1203,7 @@ dependencies = [
[[package]]
name = "daytona-toolbox-client"
version = "0.1.0"
source = "git+https://github.com/brynary/daytona-sdk-rust#31f01e80875f615bb9e26fe6f857df2465ae6b56"
source = "git+https://github.com/brynary/daytona-sdk-rust?rev=be9adf6#be9adf69438c1c704af56c82c54afa6cefa6efae"
dependencies = [
"reqwest 0.12.28",
"reqwest-middleware",

View file

@ -51,8 +51,8 @@ jsonwebtoken = { version = "10", features = ["aws_lc_rs"] }
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-webpki-roots"] }
futures-util = "0.3"
openssh = "0.11"
daytona-sdk = { git = "https://github.com/brynary/daytona-sdk-rust", package = "daytona-sdk" }
daytona-api-client = { git = "https://github.com/brynary/daytona-sdk-rust", package = "daytona-api-client" }
daytona-sdk = { git = "https://github.com/brynary/daytona-sdk-rust", rev = "be9adf6", package = "daytona-sdk" }
daytona-api-client = { git = "https://github.com/brynary/daytona-sdk-rust", rev = "be9adf6", package = "daytona-api-client" }
# regex is extremely slow in debug builds (~10s to compile gitleaks patterns)
[profile.dev.package.regex]

View file

@ -896,29 +896,9 @@ impl Sandbox for DaytonaSandbox {
timeout: Some(std::time::Duration::from_millis(timeout_ms)),
};
// The Daytona toolbox API's ExecuteRequest does not support an `env`
// field, so we prepend `export` statements to inject env vars into the
// shell session before the actual command runs.
let command_with_env = if let Some(vars) = env_vars {
if !vars.is_empty() {
let exports: Vec<String> = vars
.iter()
.map(|(k, v)| {
let escaped = v.replace('\'', "'\\''");
format!("export {k}='{escaped}'")
})
.collect();
format!("{}\n{}", exports.join("\n"), command)
} else {
command.to_string()
}
} else {
command.to_string()
};
// Wrap with `bash -c` so pipes, env vars, and shell features work.
// The Daytona API uses direct exec, not a shell.
let wrapped = wrap_bash_command(&command_with_env);
let wrapped = wrap_bash_command(command);
let result = process_svc
.execute_command(&wrapped, options)
.await