feat(environments): Add CloudflareREPL for Cloudflare Workers Sandbox#21
Open
rawwerks wants to merge 4 commits intoalexzhang13:mainfrom
Open
feat(environments): Add CloudflareREPL for Cloudflare Workers Sandbox#21rawwerks wants to merge 4 commits intoalexzhang13:mainfrom
rawwerks wants to merge 4 commits intoalexzhang13:mainfrom
Conversation
Adds a new IsolatedEnv implementation that executes Python code in Cloudflare Workers Sandbox containers via HTTP API. Key features: - HTTP-based API (no Python SDK required) - State persistence via JSON serialization - LLM broker polling support - Per-sandbox session isolation Files: - rlm/environments/cloudflare_repl.py: CloudflareREPL implementation - rlm/environments/__init__.py: Added "cloudflare" to get_environment() - tests/test_cloudflare_repl.py: Unit tests with mocked HTTP responses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds documentation and Cloudflare Worker for CloudflareREPL: - CLOUDFLARE.md: Setup guide with prerequisites, deployment steps, usage examples, and API reference - workers/rlm-sandbox/: Cloudflare Worker implementing sandbox endpoints - POST /sandbox/exec - Execute commands - POST /sandbox/write - Write files - GET /sandbox/read - Read files Worker deployed and tested at: https://rlm-sandbox.rawwerks.workers.dev 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace heavy mock tests with simple import tests - Add optional e2e tests (skip when RLM_CF_WORKER_URL not set) - Add cloudflare_repl_import to test_imports.py 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- RLM_CF_WORKER_URL: Default worker URL if not passed - RLM_CF_AUTH_TOKEN: Default auth token if not passed - Updated CLOUDFLARE.md with env var documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
|
I will get to this later, I just don't have a Cloudflare sandbox to test this on yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
CloudflareREPL- a newIsolatedEnvimplementation that runs Python code in Cloudflare Workers Sandbox containers.Why Cloudflare Workers Sandbox?
What's Included
rlm/environments/cloudflare_repl.pyworkers/rlm-sandbox/CLOUDFLARE.mdtests/test_cloudflare_repl.pySelf-Hosted Design
Users deploy their own Cloudflare Worker:
cd workers/rlm-sandbox npm install npm run deployUsage
Test Plan
RLM_CF_WORKER_URL)🤖 Generated with Claude Code