Repository navigation
Review fixes for Cloudflare sandboxes - #75
Merged
Merged
Conversation
- 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
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.
Requested by Paulo · project thread
Before: The Worker compared the bearer token with
!==, served aGET /sandboxes/{name}route and wrote astoppedstatus that nothing reads. The Python provider kept its own copy of the instance-type list and re-validated env thatHostServicealready validates. The userspace bootstrap test was in a separate file and shadowed pytest'stmp_pathfixture.After: The Worker compares the token in constant time (
crypto.subtle.timingSafeEqual) and owns the instance-type list, written once. The unused GET route andstoppedstatus 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 suppliestimingSafeEqual, because Node's WebCrypto does not have it.Verified:
npm run check,npm test(13 pass),uv run ruff check,ruff format --check,pyrightanduv run pytest(766 pass; the 2 PAM tests intest_environment_pam.pyalso fail on the base branch in this container, and CI passes them).Generated by Claude Code