Repository navigation
feat(sandbox): keep an unsized deploy_sandbox step's cpu and memory unset - #497
Merged
Merged
Conversation
A deploy_sandbox step that sets no cpu or memory still reserves 1 vCPU and 8 GiB, but now keeps both as None on the step and in its stored dict instead of writing 1.0 and 8192. A size the step chose can then be told apart from one it left to the default, which a default sizer needs. Steps stored with explicit values keep them; nothing else reads these fields. FD-5242 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eave unset [sandbox.sizer] names a SandboxSizer (impl/config, as [runner]). For each of cpu and memory, deploy_env, deploy_agent and deploy_sandbox reserve the step's own value, else the sizer's, else the step's or the provider's default. The in-tree default sizer chooses nothing, so without the table nothing changes. Each sandbox's attribution gains cpu_source and memory_source (step, sizer or default), so a deployment can see which sizes it set. FD-5241 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In container mode only the gateway gets the step's memory; its MCP servers, sidecars and service db are created with cpu alone, so they get the provider's memory. Their attribution said the step's memory source anyway. They now carry memory_source "default". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t fail a deploy - The sizer is passed vm=True when a step may deploy onto a VM: a vm-mode deploy_sandbox, or a deploy_env/deploy_agent whose sandbox type names a backend that creates VMs (may_create_vm, read from the classes). - A sizer that raises or returns something other than a SandboxSize is logged and taken to choose nothing. - A stored deploy_sandbox step with the old default pair (1.0, 8192), which every unsized step was saved with, reads as unsized; to_dict leaves an unset size out rather than writing null. - A gateway's containers that don't take the step's memory get the source "provider", so their events aren't read as sized. - cpu_source/memory_source stay out of the names, labels and tags boat, daytona, sail_vm, coreweave and tenki build from attribution. - [sandbox] sizer = "pkg:Cls" works at runtime, as describe already accepted. FD-5241, FD-5242 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
revan-aleti
approved these changes
Nov 7, 2026
canersoz-scaleai
approved these changes
Nov 9, 2026
…aved 1.0/8192 A container-mode deploy_sandbox on a VM backend (modal_vm) runs in a VM of its own whose memory is the size chosen, so the sizer is now told vm=True for it too. A step that sets cpu=1.0 and memory_mb=8192 is now saved with size_set, so a reload keeps the pair instead of reading it as a step stored before sizes could be unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stored cpu=1.0 / memory_mb=8192 was read as unset when it carried no size_set marker, so a step saved with that size before this change could be resized by a sizer. A stored size is now always the step's own; only a field the dict leaves out is unset. The size_set marker is no longer needed and is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sizes Sizes now live on the task: measured usage suggests them and a person applies them as a task edit, so nothing chooses a size while a run deploys. This removes the [sandbox.sizer] seam (sizing.py, may_create_vm, the size-source attribution keys and the provider name hygiene that went with them) and leaves deploy_env and deploy_agent as on main. deploy_sandbox keeps the part that stands on its own: cpu and memory_mb may be unset (None), an unset size is left out of the stored dict, a stored size is kept as written, and an unset size reserves 1 vCPU / 8 GiB as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
A
deploy_sandboxstep that sets no cpu or memory now keeps them unset (None) on the step and in its stored dict, instead of writing1.0and8192. It still reserves 1 vCPU and 8 GiB when it deploys (DEFAULT_CPU/DEFAULT_MEMORY_MB), so no sandbox changes size.This lets a reader tell a size the step chose apart from one it left to the default. Hub-side sizing writes explicit sizes onto tasks from measured usage (scaleapi#174094) and needs that distinction to know which steps it may size.
to_dictleaves an unset size out, so a reader that predates this never sees a null.from_dictkeeps any stored size as written; only a field the dict leaves out is unset.executeresolves the default at deploy time and logs the size it actually reserves.An earlier version of this PR added a runtime
[sandbox.sizer]seam andcpu_source/memory_sourceattribution. Both were dropped: sizes are now written onto tasks explicitly.Testing
tst/unit/task_step/deploy_sandbox_default_cpu_test.py: an unsized step stays unsized whether built in code or loaded from a dict, still reserves 1 vCPU / 8 GiB, and a stored size is kept as written. CI is green.🤖 Generated with Claude Code


Confidence Score: 5/5
This PR appears safe to merge; no blocking issues were found.Summary
Unsized
deploy_sandboxsteps now keep CPU and memory unset without changing the resources requested at deployment.No new actionable issues found. The earlier findings are addressed by preserving stored sizes and removing runtime sizing.
Reviews (12) · Last reviewed commit: "refactor(sandbox): drop the runtime size..." · Reviewed by Greptile