Skip to content
providerkit
GitHub

BackgroundRemoteOptions

Defined in: agents/src/runs.ts:85

  • Omit<BackgroundBase, "session" | "historyLimit" | "prepareHistory" | "memory">
Type Parameter
T
agent: RemoteAgent<T>;

Defined in: agents/src/runs.ts:89


optional createContinuation?: (input) => Promise<BackgroundContinuationResult>;

Defined in: agents/src/runs.ts:105

Optional durable, owner-scoped create-or-reconcile capability. Required only to cancel a suspended logical run. Also used for answers when supplied. Never substitute a local cache or an idempotency flag for atomic host storage. See BackgroundContinuationInput.

Parameter Type
input BackgroundContinuationInput

Promise<BackgroundContinuationResult>

BackgroundOptions.createContinuation


enqueue: (id) => Promise<void>;

Defined in: agents/src/runs.ts:112

Await durable queue acceptance. A worker calls runs.drive(id, background.handlers). The host must also run runs.sweep on boot and periodically, and drain on shutdown.

Parameter Type
id string

Promise<void>

BackgroundOptions.enqueue


optional events?: EventDurability;

Defined in: agents/src/runs.ts:109

Coalesced progress uses emit by default. Awaited mode needs Run.append (server 0.21+).

BackgroundOptions.events


kind: string;

Defined in: agents/src/runs.ts:99

Dedicated handler key for this agent version.

BackgroundOptions.kind


optional onSegment?: SegmentHook;

Defined in: agents/src/runs.ts:116

Awaited before execution and after the SDK journal settles. May repeat after worker loss; the host must deduplicate/reconcile external effects. This is not host-row commit proof.

BackgroundOptions.onSegment


policy: (context) =>
| BackgroundPolicy
| Promise<BackgroundPolicy>;

Defined in: agents/src/runs.ts:113

Parameter Type
context BackgroundContext

| BackgroundPolicy | Promise<BackgroundPolicy>

BackgroundOptions.policy


runs: BackgroundRuns;

Defined in: agents/src/runs.ts:101

Injected create must resolve after its transaction commits. Only then is enqueue called.

BackgroundOptions.runs