fix: update Daytona SDK executeCommand result type

This commit is contained in:
Nathan Flurry 2026-01-28 04:34:25 -08:00
parent 9e9514f2e8
commit 3552ff0683

View file

@ -95,19 +95,19 @@ await new Promise((r) => setTimeout(r, 2000));
const envCheck = await sandbox.process.executeCommand( const envCheck = await sandbox.process.executeCommand(
"env | grep -E 'ANTHROPIC|OPENAI' | sed 's/=.*/=<set>/'", "env | grep -E 'ANTHROPIC|OPENAI' | sed 's/=.*/=<set>/'",
); );
console.log("Sandbox env:", envCheck.result.output || "(none)"); console.log("Sandbox env:", envCheck.result || "(none)");
const binCheck = await sandbox.process.executeCommand( const binCheck = await sandbox.process.executeCommand(
"ls -la /root/.local/share/sandbox-agent/bin/", "ls -la /root/.local/share/sandbox-agent/bin/",
); );
console.log("Agent binaries:", binCheck.result.output); console.log("Agent binaries:", binCheck.result);
// Network connectivity test // Network connectivity test
console.log("Testing network connectivity..."); console.log("Testing network connectivity...");
const netTest = await sandbox.process.executeCommand( const netTest = await sandbox.process.executeCommand(
"curl -s -o /dev/null -w '%{http_code}' --connect-timeout 5 https://api.anthropic.com/v1/messages 2>&1 || echo 'FAILED'", "curl -s -o /dev/null -w '%{http_code}' --connect-timeout 5 https://api.anthropic.com/v1/messages 2>&1 || echo 'FAILED'",
); );
const httpCode = netTest.result.output?.trim(); const httpCode = netTest.result?.trim();
if (httpCode === "405" || httpCode === "401") { if (httpCode === "405" || httpCode === "401") {
console.log("api.anthropic.com: reachable"); console.log("api.anthropic.com: reachable");
} else if (httpCode === "000" || httpCode === "FAILED" || !httpCode) { } else if (httpCode === "000" || httpCode === "FAILED" || !httpCode) {
@ -125,9 +125,9 @@ const cleanup = async () => {
const logs = await sandbox.process.executeCommand( const logs = await sandbox.process.executeCommand(
"cat /tmp/sandbox-agent.log 2>/dev/null | tail -50", "cat /tmp/sandbox-agent.log 2>/dev/null | tail -50",
); );
if (logs.result.output) { if (logs.result) {
console.log("\n--- Server logs ---"); console.log("\n--- Server logs ---");
console.log(logs.result.output); console.log(logs.result);
} }
console.log("Cleaning up..."); console.log("Cleaning up...");
await sandbox.delete(60); await sandbox.delete(60);