Skip to main content
A Session holds one or more environments. See Concepts → The lifecycle for how reset / login / evaluate fit together; this page is the API reference.

Creating

Provide exactly one of envs, testcase, or artifacts.
VMs are killed timeout seconds after creation (default 1800 = 30 min):
testcase= auto-resets. envs= does not — call session.reset() first thing yourself. To score a run with evaluate(), create the session with testcase= — it provisions the testcase’s envs and links the scoring config in one step. Sessions created from envs= or artifacts= cannot be evaluated.

Operations

reset()

Initialize mutation logging on every env. Call this before login and the agent run — see Concepts → Reset.

get_state()

Flush pending writes and return mutations per env.

evaluate(value=None)

Score the session against its testcase. Only sessions created with testcase= can be evaluated — the testcase carries the scoring config. value is required for OUTPUT scoring; omit for MUTATION-only.

get_public_url(port=None)

Browser-accessible URLs per env, keyed by alias.

login(browser) / desktop login

For app-sim sessions, pass a Playwright Browser. For desktop sessions, use desktop.sdk.login(session) instead — session.login(browser) raises if session.desktop_env is set. Full pattern: Examples → Full evaluation.

close()

Idempotent. Wrap session work in try/finally so VMs go away on crash.

Accessing envs

Properties