Follow the request
- Connections establish prerequisites. The Sandbox connection identifies cloud access; the model connection identifies an endpoint, model, and protocol. Both must be verified and enabled.
- The Session pins configuration. The selected Harness and connection configuration become its execution context. Direct creation does not require an Agent template.
- The Run represents one submission. The example saves its input and idempotency key before submitting. Reusing that request after a lost response recovers the original Run instead of creating a second task.
- The control plane schedules execution. It owns cloud resources and execution records. Inside the Sandbox, Runtime supervises the Harness process; the Harness uses the model to perform the task.
- State and events are persisted. Observers read durable execution state. This example polls; an event-stream client can also reconnect to observe the original Run.
- Artifacts are exported before completion. The Harness receives a Run-specific output directory. Ordinary workspace files are not automatically exported artifacts.
- Closing releases cloud resources. Run completion and Session closure are separate actions. Exported artifacts remain in control-plane storage and can be downloaded after closure.
Match the tutorial’s output to the work
Both programs validate the size/hash of every listed download before closure and require at least one file containing
Hello from Hexagon, allowing surrounding whitespace. After closure, they re-download the first listed Artifact and compare its bytes. In the recorded cloud runs, each SDK produced one 19-byte artifact, so that single-file retention check covered the entire exported set for those runs. Do not generalize the program’s first-file recheck into an all-files retention check for a different task.
The same tutorial as a short sequence
This diagram summarizes the successful path; waiting, unknown remote outcomes and retries follow the failure guidance in the tutorial. Runtime is the supervisor inside the Sandbox; Harness is the Agent engine it runs. Your Python or TypeScript process is a client of the control plane. The diagram’s combined control-plane/database participant keeps the sequence short; events are committed before observation, and exported bytes are stored independently of the cloud resource. The tutorial polls rather than subscribing to SSE. Polling does not prevent durable events from being recorded: Console and the event API can inspect the same Run later. Console’s Initialization view describes the pinned configuration; Run input/output and events describe the execution; Fleet/resource-operation records describe allocation and cleanup. Do not read those separate records as one shared success flag.Compare the records in Console
Use the printed IDs to find the Session and Run. Check pinned configuration, input, output, and resource operations. Sandbox state, Runtime reachability, and Run state describe separate objects. A completed Run does not mean its Sandbox was deleted; an unreachable Runtime does not prove that its process stopped. For another turn, submit a new Run to the same still-open Session. The tutorial explicitly closes its Session, so a new experiment needs a new Session. Closure is terminal, unlike idle suspension.
Idle suspension has different preservation rules from closure. Memory, filesystem, and process continuity also vary by Provider. Read Serverless Sessions before depending on a particular behavior.
Choose your next experiment
The completed tutorial is a fixed example, not a background Agent waiting for new work. Keep its journal as evidence and create a new Session for the next experiment. Learn the public object model in Session, Run and Agent; implementation ownership is described in the architecture.
For another execution setup, read choosing a combination; for event persistence and replay, read events and recovery.