On remote execution, persistence is controlled by
sessionId. Without sessionId, requests run as ephemeral executions.Ephemeral vs persistent
| Mode | State between runs | Performance profile | Best for |
|---|---|---|---|
ephemeral | none | < 150ms (warm pool) | isolated one-off tasks |
persistent | yes | ~300ms (cold), ~120ms (warm) | multi-step workflows |
Ephemeral mode performance depends on your
poolStrategy. The default fast strategy uses a background cleanup loop to ensure instant availability.What persists in persistent mode
Inside the same container, subsequent runs can reuse:- files under
/sandbox - installed dependencies from previous operations
- runtime artifacts generated during prior executions
CLI usage
--persist is separate from --persistent:
--persistent: reuse container across runs.--persist: keep container alive after completion for manual inspection.
Library usage
API session usage
UsesessionId with POST /execute.
sessionId for follow-up calls, then delete explicitly:
RemoteIsol8.stop() also deletes the remote session when sessionId is configured.File movement patterns
Inject files before execution
Retrieve files after execution
Direct file API in active session
POST /fileupload base64 contentGET /filedownload base64 content
Session lifecycle and pruning
Server-side session cleanup is controlled by:cleanup.autoPrunecleanup.maxContainerAgeMs
maxContainerAgeMs or disable auto-pruning.
Choosing the right mode
Chooseephemeral when:
- workloads are independent
- isolation between requests is a priority
- you need predictable clean-state semantics
persistent when:
- workflows are iterative/multi-step
- file reuse is central to task flow
- setup cost should be amortized across related runs
FAQ
What is the difference between `--persistent` and `--persist`?
What is the difference between `--persistent` and `--persist`?
--persistent enables state reuse across runs. --persist keeps the container alive after execution for inspection/debugging.Can I switch runtime inside one persistent session?
Can I switch runtime inside one persistent session?
No. A persistent container is runtime-bound. Create a new session/engine for a different runtime.
How do I clean up remote persistent sessions?
How do I clean up remote persistent sessions?
Call
DELETE /session/{id} directly, or use RemoteIsol8.stop() when your client was created with sessionId.Troubleshooting quick checks
- State not retained between runs: ensure
--persistent(CLI) orsessionId(API/RemoteIsol8) is set. File operations require a sessionId: createRemoteIsol8withsessionIdbeforeputFile/getFile.- Session disappears unexpectedly: check
cleanup.autoPruneandcleanup.maxContainerAgeMsin config. - Runtime switch error in persistent mode: use separate sessions per runtime.