Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/code-interpreter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM docker.io/cloudflare/sandbox:0.6.0
FROM docker.io/cloudflare/sandbox:0.6.0-python
2 changes: 1 addition & 1 deletion examples/code-interpreter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function callCloudflareAPI(

async function executePythonCode(env: Env, code: string): Promise<string> {
const sandboxId = env.Sandbox.idFromName('default');
const sandbox = getSandbox(env.Sandbox, sandboxId.toString());
const sandbox = getSandbox(env.Sandbox, sandboxId.toString().slice(0, 63));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ERROR] Sandbox execution failed: SecurityError: Sandbox ID must be 1-63 characters long.

Reference: https://github.com/cloudflare/sandbox-sdk/blob/main/packages/sandbox/src/security.ts#L54

const pythonCtx = await sandbox.createCodeContext({ language: 'python' });
const result = await sandbox.runCode(code, {
context: pythonCtx
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/cloudflare/sandbox:0.6.0
FROM docker.io/cloudflare/sandbox:0.6.0-python

# Required during local development to access exposed ports
EXPOSE 8080
Loading