Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

fix: resolve CLI sandbox logs timeout and waitForSandboxEnd bug (#1148)

Jakub Dobry6798071059bd
diff --git a/packages/cli/src/commands/sandbox/logs.ts b/packages/cli/src/commands/sandbox/logs.ts
index eac6741e5..caf78a57e 100644
--- a/packages/cli/src/commands/sandbox/logs.ts
+++ b/packages/cli/src/commands/sandbox/logs.ts
@@ -121,6 +121,8 @@ export const logsCommand = new commander.Command('logs')
)
}
+ if (!opts?.follow) break
+
const isSandboxRunning = await isRunning(sandboxID)
if (!isSandboxRunning && logs.length === 0 && isFirstRun) {
diff --git a/packages/cli/src/commands/sandbox/utils.ts b/packages/cli/src/commands/sandbox/utils.ts
index 063e60ba6..9d2117bd2 100644
--- a/packages/cli/src/commands/sandbox/utils.ts
+++ b/packages/cli/src/commands/sandbox/utils.ts
@@ -43,7 +43,7 @@ export function waitForSandboxEnd(sandboxID: string) {
monitor()
- return () => isRunning
+ return () => running
}
export async function isRunning(sandboxID: string) {