- Experiment Conflicts and Environment Contamination. When an AI Agent tries multiple solutions, experimental code changes may interfere with the developer’s main workflow or contaminate the current runtime environment. Once an experiment goes wrong, recovery often requires a rollback, and valuable exploration paths cannot be preserved.
- Inability to Explore Multiple Solutions in Parallel. Constrained to a single environment, the AI Agent can only test different approaches sequentially. This serial mode is not only inefficient, but more importantly, it limits the breadth of AI exploration — unable to simultaneously validate multiple parallel hypotheses or implementation approaches.
- Limited Scalability of Computing Power. When facing tasks that require “Wide-Research” (e.g., comparing 100 solutions simultaneously, batch-generating multiple implementation versions), the single-environment architecture fundamentally restricts the ability to parallelize task processing.
- Multi-Timeline Exploration Architecture: Like a decision tree, the AI Agent can start from the same baseline state and create multiple independent sandbox copies, each exploring a different solution path without interfering with each other.
- True Parallel Computing Capability: By splitting large tasks into batch subtasks, the AI Agent can scale its computing power by tens or even hundreds of times, simultaneously processing dozens or hundreds of exploration branches.
- Zero-Risk Experimentation Environment: Cloned sandboxes are completely isolated, allowing the AI to freely experiment and test various possibilities without affecting the original environment or the developer’s main workflow.
- Efficient Resource Utilization: Although multiple sandbox instances may be launched simultaneously, by dynamically managing and promptly terminating branches (sandbox instances) that are no longer valuable, overall computing resource consumption can be kept within a reasonable range.
Terminology
- Origin Sandbox: The original sandbox instance being cloned.
- New Sandbox: The new sandbox instance created through the clone operation.
Feature Overview
The sandbox clone feature currently supports the following two scenarios:- Clone a sandbox in Running state
- Clone a sandbox in Paused state
Cloning a Running Sandbox
During the clone process:- The origin sandbox will be briefly suspended during cloning;
- The sandbox instance is unavailable during suspension;
- The suspension duration is close to the time required for a single pause operation.
- Status is restored to running;
- The existing pause record will be refreshed to a new pause record, based on the current sandbox state;
- A new snapshot template record is generated (to delete this snapshot template, you need to first terminate both the origin sandbox and the cloned sandboxes);
- Status is running;
- Ready to use immediately.
Cloning a Paused Sandbox
During the clone process: When the origin sandbox is in a paused state:- The clone process will not trigger the origin sandbox to start;
- The origin sandbox remains in paused state.
- The existing pause record is not cleared;
- A new snapshot template record is generated (to delete this snapshot template, you need to first terminate both the origin sandbox and the cloned sandboxes);
- Status is running;
- Ready to use immediately.
New Sandbox Attribute Inheritance Rules
| Attribute | Inherited |
|---|---|
| auto resume | Yes |
| auto pause | No |
Parameter Description
count: The number of sandbox instances to clone. The minimum value is 1, and the maximum must not exceed the platform’s concurrent running sandbox instance limit (see: Sandbox Quota Limit);strict: Whether to strictly clone according to the number specified in thecountparameter, default is false.true: If the number of successfully cloned instances is less thancount, a clone failure is returned; successfully created sandboxes will be automatically released.false: Returns the actual number of successfully cloned sandbox instances.
timeout(timeoutMs): The timeout for cloning sandbox instances.- If not specified:
- When the origin sandbox is in running state, it inherits its timeout configuration;
- When the origin sandbox is in paused state, the default value of 5 minutes is used.
- If not specified:
Return Value
After a successful clone operation, an object is returned containing the following properties:| Property | Description |
|---|---|
sandboxes | List of successfully cloned sandbox instances |
count | Number of successfully cloned sandboxes |
snapshot_template_id | Snapshot template ID generated during the clone process |
Code Examples
Bash