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
storeStorerequiredThe store the thread's log lives in, usually the same sqlite() the agent ran with. See Store.
threadId / thread_idThreadIdrequiredThe id of the thread to open, such as the thread id in a RunResult.
branchId / branch_idBranchIdThe branch to open. Omitted: the thread's main branch.
sandboxSandboxThe 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
Returns an error value with one of these codes: not_found, log_corrupt, unsupported_format, unsupported_critical_event.