Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
Remove unnecessary clear
Tomas Valenta59a02e44e3c7
diff --git a/packages/js-sdk/src/sandbox/filesystem/index.ts b/packages/js-sdk/src/sandbox/filesystem/index.tsindex cfb851644..8f6576dff 100644--- a/packages/js-sdk/src/sandbox/filesystem/index.ts+++ b/packages/js-sdk/src/sandbox/filesystem/index.ts@@ -189,18 +189,11 @@ export class Filesystem {},}, {signal: controller.signal,+ timeoutMs: opts?.timeout,})clearTimeout(reqTimeout)- const timeout = opts?.timeout ?? requestTimeoutMs-- if (timeout > 0) {- setTimeout(() => {- controller.abort()- }, timeout)- }-return new WatchHandle(() => controller.abort(),events,diff --git a/packages/js-sdk/src/sandbox/process/index.ts b/packages/js-sdk/src/sandbox/process/index.tsindex 4a2ca5f96..859a57058 100644--- a/packages/js-sdk/src/sandbox/process/index.ts+++ b/packages/js-sdk/src/sandbox/process/index.ts@@ -88,18 +88,11 @@ export class Process {},}, {signal: controller.signal,+ timeoutMs: opts?.timeout,})clearTimeout(reqTimeout)- const timeout = opts?.timeout ?? requestTimeoutMs-- if (timeout > 0) {- setTimeout(() => {- controller.abort()- }, timeout)- }-return new ProcessHandle(pid,() => controller.abort(),@@ -147,20 +140,13 @@ export class Process {},}, {signal: controller.signal,+ timeoutMs: opts?.timeout,})const startEvent: StartResponse = (await events[Symbol.asyncIterator]().next()).valueclearTimeout(reqTimeout)- const timeout = opts?.timeout ?? requestTimeoutMs-- if (timeout > 0) {- setTimeout(() => {- controller.abort()- }, timeout)- }-if (startEvent.event?.event.case !== 'start') {throw new Error('Expected start event')}diff --git a/packages/js-sdk/src/sandbox/pty.ts b/packages/js-sdk/src/sandbox/pty.tsindex acf01e8ca..c3c832e67 100644--- a/packages/js-sdk/src/sandbox/pty.ts+++ b/packages/js-sdk/src/sandbox/pty.ts@@ -27,12 +27,12 @@ export class Pty {async create({ cols, rows }: {cols: number,rows: number,- }, opts?: Pick<ConnectionOpts, 'requestTimeoutMs'>) {+ }, opts?: Pick<ConnectionOpts, 'requestTimeoutMs'> & { timeout?: number }) {const requestTimeoutMs = opts?.requestTimeoutMs ?? this.connectionConfig.requestTimeoutMsconst controller = new AbortController()- setTimeout(() => {+ const reqTimeout = setTimeout(() => {controller.abort()}, requestTimeoutMs)@@ -58,6 +58,7 @@ export class Pty {},}, {signal: controller.signal,+ timeoutMs: opts?.timeout,})const startEvent: StartResponse = (await events[Symbol.asyncIterator]().next()).value@@ -66,6 +67,8 @@ export class Pty {throw new Error('Expected start event')}+ clearTimeout(reqTimeout)+const pid = startEvent.event.event.value.pidconst input = await this.streamInput(pid, opts)@@ -123,12 +126,12 @@ export class Pty {}}- private async streamInput(pid: number, opts?: Pick<ConnectionOpts, 'requestTimeoutMs'>) {+ private async streamInput(pid: number, opts?: Pick<ConnectionOpts, 'requestTimeoutMs'> & { timeout?: number }) {const requestTimeoutMs = opts?.requestTimeoutMs ?? this.connectionConfig.requestTimeoutMsconst controller = new AbortController()- setTimeout(() => {+ const reqTimeout = setTimeout(() => {controller.abort()}, requestTimeoutMs)@@ -136,8 +139,11 @@ export class Pty {this.rpc.streamInput(events, {signal: controller.signal,+ timeoutMs: opts?.timeout,})+ clearTimeout(reqTimeout)+events.enqueue({event: {case: 'start',