Skip to content

feat(sandbox): read back the shape a sandbox runs in - #13

Merged
loks0n merged 1 commit into
mainfrom
chore/update-get-sandbox
Aug 21, 2026
Merged

loks0n merged 1 commit into
mainfrom
chore/update-get-sandbox

Conversation

@loks0n

@loks0n loks0n commented Aug 21, 2026

Copy link
Copy Markdown
Member

Orchestrator 1.4.0 reports the image, cpu and memory a sandbox is running in on every sandbox status. It records them when the pod is created, so a caller that did not create the sandbox — or has forgotten what it asked for — can read what it got instead of keeping a record of its own. They are null for a sandbox created before the orchestrator recorded a shape.

Comparing the orchestrator at v1.3.1..HEAD, this is the only API-surface change for 1.4.0: pool.Status, deployments, jobs and artifacts are unchanged.

  • SandboxStatus gains image, cpu and memory, hydrated from every read.
  • Data::optionalFloat(), which accepts an int — JSON gives 2 for a whole cpu, not 2.0.
  • One test covering both the shape and its absence; a note in the README's sandbox section.

composer test, analyze, refactor:check and format:check all pass.

The new fields sit before error in the constructor, mirroring the API docs' field order. That shifts error's position, so a positional new SandboxStatus(...) would break — named arguments are the convention here and hydration goes through fromArray(). Happy to append them at the end instead.

🤖 Generated with Claude Code

Orchestrator 1.4.0 reports the image, cpu and memory a sandbox is running
in on every sandbox status. It records them when the pod is created, so a
caller that did not create the sandbox — or has forgotten what it asked
for — can read what it got instead of keeping a record of its own. They
are null for a sandbox created before the orchestrator recorded a shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown

Greptile Summary

Adds the image, CPU, and memory shape reported by Orchestrator 1.4.0 to SandboxStatus, while preserving null values for older sandboxes.

  • Adds strict optional floating-point response parsing that accepts integer JSON numbers.
  • Hydrates the new shape fields through the shared sandbox status model.
  • Documents the fields and tests populated and absent responses.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security failures identified.

All sandbox operations converge on the updated status hydrator, the numeric parser handles the documented JSON representations, and legacy responses remain compatible through optional null fields.

Important Files Changed

Filename Overview
src/Model/Data.php Adds an optional numeric parser that accepts PHP integers and floats and consistently rejects other decoded types.
src/Model/SandboxStatus.php Exposes and hydrates optional image, CPU, and memory fields for all sandbox status operations.
tests/SandboxesTest.php Covers integer CPU normalization, populated shape values, and null fields for legacy sandbox responses.
README.md Documents the newly readable sandbox shape and its legacy null behavior.

Reviews (1): Last reviewed commit: "feat(sandbox): read back the shape a san..." | Re-trigger Greptile

@loks0n
loks0n merged commit 2f08da2 into main Aug 21, 2026
5 checks passed
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.

1 participant