Add sandbox template support across Python and Node SDKs - #12
Conversation
|
Warning Review limit reached
More reviews will be available in 22 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR introduces sandbox template support across the Celesto SDK. Computer creation now uses ChangesSandbox Template Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@js/src/computers/client.ts`:
- Around line 107-113: The error messages in buildCreateComputerBody are
misleading: instead of saying "Pass either cpus or vcpus, not both." and
similarly for memory/ramMb, update the validation error text to reflect the
actual rule — allow both when equal but require equality when both provided;
e.g., change the cpus/vcpus error to state that "cpus and vcpus must have the
same value when both are provided" and likewise change the memory/ramMb error to
"memory and ramMb must have the same value when both are provided" so the thrown
Error in buildCreateComputerBody accurately describes the validation.
In `@src/celesto/computer.py`:
- Around line 122-123: The CLI is defaulting missing metadata to misleading
values by using result.get('disk_size_mb', 0) and result.get('template_id',
'scratch') in the console.print lines (and the same pattern later), so change
those prints to detect absence and show a clear "N/A" or omit the field instead
of inventing values: update the console.print calls that use
_format_memory(result.get('disk_size_mb', 0)) and result.get('template_id',
'scratch') to check for the key (e.g., 'disk_size_mb' and 'template_id') on the
result dict and print a neutral placeholder when absent (or skip printing),
leaving _format_memory only for real numeric values. Ensure both occurrences
(the ones around the two reported line groups) are fixed.
In `@src/celesto/integrations/openai_agents/hosted.py`:
- Around line 91-97: The code starts the hosted machine but doesn’t wait for it
to finish booting, causing races; modify the logic around
self._client.computers.get / self._client.computers.start (using
self.state.computer_id) to poll the machine status after calling start until it
becomes "running" (or until a configurable timeout/attempts elapses), sleeping
briefly between polls, and raise/return a clear error if the machine fails to
reach "running" within the timeout; ensure the polling path also handles
transient API errors from get and includes a short backoff.
In `@src/celesto/sdk/client.py`:
- Around line 835-838: Update the validation error messages in the block that
checks cpus/vcpus and memory/ram_mb (where CelestoValidationError is raised) to
state the actual rule: when both values are provided they must be equal. Replace
the current "Pass either cpus or vcpus, not both." with a message like "cpus and
vcpus must have the same value when both are provided." and similarly replace
the memory error message with "memory and ram_mb must have the same value when
both are provided." to match the JS behavior and clarify the true validation
rule.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e153768b-92ec-43a9-85b9-caeb1b78c0a4
📒 Files selected for processing (14)
README.mdjs/README.mdjs/src/computers/client.tsjs/src/computers/index.tsjs/src/computers/types.tsjs/src/index.tsjs/tests/computers.test.tssrc/celesto/computer.pysrc/celesto/integrations/openai_agents/hosted.pysrc/celesto/sdk/__init__.pysrc/celesto/sdk/client.pysrc/celesto/sdk/types.pytests/test_celestoignore_spec.pytests/test_sdk.py
💤 Files with no reviewable changes (1)
- tests/test_celestoignore_spec.py
|
Docs PR opened: CelestoAI/mintlify-docs#100 Documented sandbox templates, the new list templates helper, disk size configuration, and added restoring and restorable statuses. |
Summary
template_id/templateId,template_version, anddisk_size_mb/diskSizeMbsupport.Testing
uv run ruff check .uv run pytestnpm run lintnpm testSummary by CodeRabbit
Release Notes
New Features
Documentation