When to keep state
Keep state when you want to:- Continue an agent task after a break.
- Reuse installed packages instead of installing them again.
- Keep generated files, source code, or build output.
- Restart a preview app from the same workspace.
- Hand the same computer to another job or agent.
Stop and start the same computer
The simplest way to keep state is to stop a computer instead of deleting it. A stopped computer keeps its workspace, which means the files and folders inside the computer. The example below creates a file, stops the computer, starts it again, and checks that the file is still there.The command prints
ready after the computer starts again, which means the workspace was saved.Save the computer ID or name
Use the same computer when you want the same state.- In SDK code, save the computer ID returned by
create(). - In the CLI, use the computer name shown by
celesto computer create.
Choose stop or delete
Stopping and deleting both end a work session, but they have different outcomes.| Action | What happens | Use it when |
|---|---|---|
| Stop | The computer turns off and keeps its workspace. | You plan to continue the same work later. |
| Start | The stopped computer turns on again. | You are ready to continue the saved work. |
| Delete | The computer and its workspace are removed. | You are finished with the saved work. |
Resume agent sessions
If you use Celesto with OpenAISandboxAgent, you can also save an agent session and resume it later. A session is the saved connection between the agent and its sandbox computer.
Use this when the same agent workflow needs to continue with the same files and identity. See Sandbox an OpenAI agent using Celesto or SmolVM for the session-specific code.
Troubleshooting
If a saved file is missing, check these first:- Use the same computer ID or name that created the file.
- Start the computer before running commands against it.
- Confirm that the computer was stopped, not deleted.
CLI
