Skip to content

Review fixes for Cloudflare sandboxes - #75

Merged
czpython merged 1 commit into
codex/cloudflare-sandboxfrom
claude/project-thread-6x9tw8
Oct 18, 2026
Merged

czpython merged 1 commit into
codex/cloudflare-sandboxfrom
claude/project-thread-6x9tw8

Conversation

@czpython

Copy link
Copy Markdown
Owner

Requested by Paulo · project thread

Before: The Worker compared the bearer token with !==, served a GET /sandboxes/{name} route and wrote a stopped status that nothing reads. The Python provider kept its own copy of the instance-type list and re-validated env that HostService already validates. The userspace bootstrap test was in a separate file and shadowed pytest's tmp_path fixture.

After: The Worker compares the token in constant time (crypto.subtle.timingSafeEqual) and owns the instance-type list, written once. The unused GET route and stopped status are gone. The provider sends the request and lets the Worker reject a bad size. The bootstrap tests are in one file, and AGENTS.md lists Cloudflare.

How: Edits in deploy/cloudflare/src/index.ts, src/providers/cloudflare/{api,provider}.py, and tests. A vitest setup file supplies timingSafeEqual, because Node's WebCrypto does not have it.

Verified: npm run check, npm test (13 pass), uv run ruff check, ruff format --check, pyright and uv run pytest (766 pass; the 2 PAM tests in test_environment_pam.py also fail on the base branch in this container, and CI passes them).


Generated by Claude Code

- Worker: compare the bearer token in constant time, drop the unused
  GET route and "stopped" status, derive the instance type from one list.
- Provider: the Worker owns instance-type validation; drop the env
  re-validation the host service already runs.
- Fold the userspace bootstrap test into test_bootstrap.py and list
  Cloudflare in AGENTS.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017378pkgrKkDT9egx2xjwoE
@czpython czpython self-assigned this Oct 17, 2026
@czpython
czpython merged commit 775db9f into codex/cloudflare-sandbox Oct 18, 2026
7 checks passed
@czpython
czpython deleted the claude/project-thread-6x9tw8 branch October 18, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants