@cloudflare/sandbox 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/sandbox",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudflare/sandbox-sdk"
@@ -11,11 +11,11 @@
11
11
  "@cloudflare/containers": "^0.0.30"
12
12
  },
13
13
  "devDependencies": {
14
- "@openai/agents": "^0.3.2",
14
+ "@openai/agents": "^0.3.3",
15
15
  "@repo/shared": "^0.0.0"
16
16
  },
17
17
  "peerDependencies": {
18
- "@openai/agents": "^0.3.2"
18
+ "@openai/agents": "^0.3.3"
19
19
  },
20
20
  "peerDependenciesMeta": {
21
21
  "@openai/agents": {
@@ -34,9 +34,9 @@
34
34
  "check": "biome check && npm run typecheck",
35
35
  "fix": "biome check --fix && npm run typecheck",
36
36
  "typecheck": "tsc --noEmit",
37
- "docker:local": "cd ../.. && docker build -f packages/sandbox/Dockerfile --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox-test:$npm_package_version .",
38
- "docker:publish": "cd ../.. && docker buildx build --platform linux/amd64,linux/arm64 -f packages/sandbox/Dockerfile --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox:$npm_package_version --push .",
39
- "docker:publish:beta": "cd ../.. && docker buildx build --platform linux/amd64,linux/arm64 -f packages/sandbox/Dockerfile --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox:$npm_package_version-beta --push .",
37
+ "docker:local": "cd ../.. && docker build -f packages/sandbox/Dockerfile --platform linux/amd64 --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox-test:$npm_package_version .",
38
+ "docker:publish": "cd ../.. && docker buildx build --platform linux/amd64 -f packages/sandbox/Dockerfile --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox:$npm_package_version --push .",
39
+ "docker:publish:beta": "cd ../.. && docker buildx build --platform linux/amd64 -f packages/sandbox/Dockerfile --build-arg SANDBOX_VERSION=$npm_package_version -t cloudflare/sandbox:$npm_package_version-beta --push .",
40
40
  "test": "vitest run --config vitest.config.ts \"$@\"",
41
41
  "test:e2e": "cd ../.. && vitest run --config vitest.e2e.config.ts \"$@\""
42
42
  },
@@ -267,6 +267,12 @@ export class InterpreterClient extends BaseHttpClient {
267
267
  yield buffer;
268
268
  }
269
269
  } finally {
270
+ // Cancel the stream first to properly terminate HTTP connections when breaking early
271
+ try {
272
+ await reader.cancel();
273
+ } catch {
274
+ // Ignore cancel errors (stream may already be closed)
275
+ }
270
276
  reader.releaseLock();
271
277
  }
272
278
  }
@@ -37,6 +37,12 @@ async function* parseSSE(
37
37
  }
38
38
  }
39
39
  } finally {
40
+ // Cancel the stream first to properly terminate HTTP connections when breaking early
41
+ try {
42
+ await reader.cancel();
43
+ } catch {
44
+ // Ignore cancel errors (stream may already be closed)
45
+ }
40
46
  reader.releaseLock();
41
47
  }
42
48
  }
package/src/sse-parser.ts CHANGED
@@ -72,6 +72,9 @@ export async function* parseSSEStream<T>(
72
72
  }
73
73
  } finally {
74
74
  // Clean up resources
75
+ try {
76
+ await reader.cancel();
77
+ } catch {}
75
78
  reader.releaseLock();
76
79
  }
77
80
  }
package/src/version.ts CHANGED
@@ -3,4 +3,4 @@
3
3
  * This file is auto-updated by .github/changeset-version.ts during releases
4
4
  * DO NOT EDIT MANUALLY - Changes will be overwritten on the next version bump
5
5
  */
6
- export const SDK_VERSION = '0.5.4';
6
+ export const SDK_VERSION = '0.5.6';