Skip to main content

Interface: RunPolicy

Defined in: packages/core/src/core/run-contract.ts:69

Properties​

backoff?​

optional backoff?: object

Defined in: packages/core/src/core/run-contract.ts:80

Delay between drives at the place. Default { initialMs: 1_000, maxMs: 300_000 }.

initialMs​

initialMs: number

maxMs​

maxMs: number


budget?​

optional budget?: object

Defined in: packages/core/src/core/run-contract.ts:97

steps?​

optional steps?: number

wallMs?​

optional wallMs?: number


maxAttempts?​

optional maxAttempts?: number

Defined in: packages/core/src/core/run-contract.ts:71

Drives per run. Default 5.


maxInfrastructureRedrives?​

optional maxInfrastructureRedrives?: number

Defined in: packages/core/src/core/run-contract.ts:78

Consecutive infrastructure failures before the run stops with retry-exhausted. They do not use attempts, so a write that fails on every drive (an entry too large for its store) needs its own bound. Any other outcome resets the count. Default 10.


stepIdleTimeoutMs?​

optional stepIdleTimeoutMs?: number

Defined in: packages/core/src/core/run-contract.ts:88

How long the model's stream may send nothing before the step's model call is treated as stalled (streamIdleMiddleware) and retried by AI SDK's streamRetries. Times the provider's stream alone, never the step's tool execution. Default 120_000 at a durable place. Also each ordinary tool's limit while toolTimeoutMs is unset.


toolTimeoutMs?​

optional toolTimeoutMs?: number

Defined in: packages/core/src/core/run-contract.ts:96

How long one ordinary tool call may run, from its start, before it ends as a tool error (AI SDK timeout.tools, which aborts the call's abortSignal). Unset, a tool's limit is stepIdleTimeoutMs. A tool's own timeoutMs declaration wins over it; a tool that runs a child loop (childRun) and a provider-executed tool get no tool limit.

Methods​

classify()?​

optional classify(error): FailureClassification | undefined

Defined in: packages/core/src/core/run-contract.ts:103

Host override. Return undefined to use the default classification. A permanent answer may carry the StopReason the run settles with ({ class: 'permanent', reason: 'credits-exhausted' }).

Parameters​

error​

unknown

Returns​

FailureClassification | undefined