Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Fix process output

Tomas Valentac86c8244f4eb
diff --git a/api-service/playground/src/sessions/process.ts b/api-service/playground/src/sessions/process.ts
index ed6d69a4c..3adf1a6ba 100644
--- a/api-service/playground/src/sessions/process.ts
+++ b/api-service/playground/src/sessions/process.ts
@@ -31,20 +31,19 @@ export class CachedProcess {
if (this.started) throw new Error('Process already started')
this.started = true
- const stderr: OutStderrResponse[] = []
- const stdout: OutStdoutResponse[] = []
-
const process = await createSessionProcess({
manager: this.manager,
+ onStderr: (o) => this.stderr.push(o),
+ onStdout: (o) => this.stdout.push(o),
...params,
- onStderr: (o) => stderr.push(o),
- onStdout: (o) => stdout.push(o),
})
process.exited.finally(() => {
this.finished = true
})
+
+ await process.exited
this.process = process
return process
}