openThread / open_thread

A handle for inspection and control, independent of any in-memory run.

Import from @threads/core (TypeScript) or threads (Python).

function openThread(store: Store, threadId: ThreadId, options?: {
  branchId?: BranchId;
  sandbox?: Sandbox;
}): Promise<Result<Thread>>

Parameters

storeStorerequired

The store the thread's log lives in, usually the same sqlite() the agent ran with. See Store.

threadId / thread_idThreadIdrequired

The id of the thread to open, such as the thread id in a RunResult.

branchId / branch_idBranchId

The branch to open. Omitted: the thread's main branch.

sandboxSandbox

The sandbox provider that restores snapshots for fork(). Inspection (timeline, branches, forkPoints, saveCase) doesn't need it; fork() on a handle without one fails with sandbox_required. Omit it when you only inspect. See Sandbox.

Returns

Thread

Returns an error value with one of these codes: not_found, log_corrupt, unsupported_format, unsupported_critical_event.

Edit on GitHub

On this page