How to Manage DigitalOcean Harness Runtime Sessionspublic

Last verified 27 Oct 2026

DigitalOcean Harness Runtime provides managed, hardware-isolated microVM sandboxes with built-in tools such as Chromium to run harnesses and execute arbitrary code. Rich lifecycle APIs preserve conversational history and working state across sessions, letting you pause, resume, and fork work to control costs and adapt to the nonlinear nature of agentic workflows. Scale complete agents such as Claude Code or use sandboxes independently for code execution, all through the same service. See What You Can Build for example use cases.

All sessions are displayed in the Sessions tab of Harness Runtime.

Use doctl harness-runtime commands or the Control Panel to manage the lifecycle of sessions.

Pause, Resume, and Remove a Session Using the CLI

Provide the session name or ID to the doctl command. To list sessions and their status, use doctl harness-runtime list. To show details for one session, use doctl harness-runtime show <name>.

Pausing a session suspends its compute while preserving the workspace, the agent’s state, and your conversation history. You can resume it and pick up exactly where you left off to save cost on work that spans hours or days.

doctl harness-runtime pause <name>
doctl harness-runtime show <name>
doctl harness-runtime resume <name>

Sessions auto-pause after 15 minutes of inactivity. Sending a new message to a paused session resumes it.

If the session is bound to a reuse trigger, resuming it or sending it a message wakes it, and the trigger’s firings fail until you pause the session again. For details, see Choose a Session Mode.

Detach from a Session

Detach closes your local terminal connection and leaves the session running. From an attached prompt, press Ctrl+D, or press Ctrl+C when no turn is running.

Reattach to the session again with doctl harness-runtime launch <name>.

To remove a session when you no longer need it, run:

doctl harness-runtime remove <name>

Removing a session tears down the sandbox and stops compute charges. It does not delete the Environment Config that was saved when you created the session. To delete that config, see Delete an Environment Config.

Cancel a Run

Cancel stops the agent turn that is in progress and leaves the session ready for the next prompt. It does not pause the session, detach your terminal, or undo work the turn already did. To suspend compute, pause the session instead.

To cancel from any terminal, run the following command. The session name or ID is required:

doctl harness-runtime cancel <name>

Not every adapter can interrupt a turn. See Run Cancellation by Adapter. If the adapter cannot interrupt a turn (for example, codex-agentapi), the command exits with an error and the turn keeps running until it finishes. With -o json, the output reports the outcome as unsupported. If no turn is running, the command reports that and exits successfully, so it is safe to run unconditionally.

Without the --run-id flag, the command cancels whichever turn is running when the request arrives. To cancel only a specific turn, pass its run ID, which doctl harness-runtime prompt and the run.started event report:

doctl harness-runtime cancel <name> --run-id <run-id>

If that turn has already finished, the command does not stop anything, including a turn that started after it.

While attached with doctl harness-runtime launch:

  • Press Ctrl+C once while a turn is running to cancel it. Press Ctrl+C again to detach. On a codex-agentapi session, Ctrl+C detaches immediately.
  • On an empty prompt, press Esc to cancel. If you have typed text, Esc clears the input first.
  • While an approval prompt is open, Ctrl+C detaches and Esc does not cancel. Answer the request to continue.

For doctl harness-runtime prompt, press Ctrl+C once to cancel that run.

Use the Control Panel

You can view sessions and chat history in the Sessions tab of Harness Runtime in DigitalOcean Control Panel. To pause or resume a session, click … for the session and select Pause or Resume.

To cancel a run, open the session from the Sessions tab and click Stop while a turn is running. If the adapter cannot interrupt, the Control Panel indicates that and the run continues until it finishes.

Click Destroy Session to remove the session.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.