Skip to main content

Interface: OrchestratorConfig

Defined in: packages/orchestration/src/orchestrator.ts:63

Properties​

budgetTotal?​

optional budgetTotal?: number

Defined in: packages/orchestration/src/orchestrator.ts:102

USD every run this orchestrator starts may spend together, counted from the runs it recorded in this process plus what its running runs have spent so far. A run that reaches it fails (RunBudgetExceededError, scope total) and no run starts after (BudgetExhaustedError).


concurrency?​

optional concurrency?: (ticket, agent) => ConcurrencyScope[]

Defined in: packages/orchestration/src/orchestrator.ts:86

Limits beyond each agent's maxConcurrent, per run (e.g. [{ scope: \org:${orgId}`, limit: 4 }]`).

Parameters​

ticket​

Ticket

agent​

RegisteredAgent

Returns​

ConcurrencyScope[]


customPricing?​

optional customPricing?: Record<string, ModelRates>

Defined in: packages/orchestration/src/orchestrator.ts:71


defaultModel?​

optional defaultModel?: string

Defined in: packages/orchestration/src/orchestrator.ts:70

Default model ID for cost estimation (e.g. 'gpt-4o', 'claude-sonnet-5')


heartbeatMs?​

optional heartbeatMs?: number

Defined in: packages/orchestration/src/orchestrator.ts:90

How often a running run heartbeats, renews its slots and checks for a cross-instance cancel. Default 30s.


keepAlive?​

optional keepAlive?: (run) => void

Defined in: packages/orchestration/src/orchestrator.ts:110

Called with every run the orchestrator starts — scheduler, dispatch, dispatchOnce, a resumed question — as a promise that settles (never rejects) when the run does. On serverless, pass the platform's waitUntil (@vercel/functions), so a run a web request dispatched finishes after the response instead of freezing mid-step.

Parameters​

run​

Promise<void>

Returns​

void


registryOptions?​

optional registryOptions?: AgentRegistryOptions

Defined in: packages/orchestration/src/orchestrator.ts:77

Options for the agent registry (e.g. DB-backed concurrency counting)


schedulerIntervalMs?​

optional schedulerIntervalMs?: number

Defined in: packages/orchestration/src/orchestrator.ts:73

Scheduler heartbeat interval in ms (default: 30000)


slotLeaseMs?​

optional slotLeaseMs?: number

Defined in: packages/orchestration/src/orchestrator.ts:88

Slot lease without renewal. Default 15 minutes.


slots?​

optional slots?: SlotStore

Defined in: packages/orchestration/src/orchestrator.ts:84

Where concurrency slots are held — every agent's maxConcurrent and the concurrency scopes. Default: this process's memory. On serverless, pass a shared store (PostgresSlotStore from @baleybots/postgres) so a limit binds across instances and a crashed instance's slots expire.


spend?​

optional spend?: SpendStore

Defined in: packages/orchestration/src/orchestrator.ts:95

Where run costs are recorded so budgets see every instance's spend (PostgresSpendStore). Default: this process's memory.


stores​

stores: object

Defined in: packages/orchestration/src/orchestrator.ts:65

Where tickets and runs live: the in-memory pair, SupabaseTicketStore / SupabaseRunStore, or @baleybots/postgres's.

runs​

runs: RunStore

tickets​

tickets: TicketStore


ticketDefaults?​

optional ticketDefaults?: Partial<TicketConfig>

Defined in: packages/orchestration/src/orchestrator.ts:75

Merged into every createTicket call (metadata key by key).