Open Agent Loops
API Reference

DispatcherOptions

@open-agent-loops/core


Defined in: channels/dispatcher.types.ts:46

Options for a Dispatcher. Provide the agent one of two ways, mutually exclusive:

  • base — shared runAgent config; the dispatcher splats it into each run (optionally with run overriding how runs execute).
  • agent — one self-contained Agent value that closes over its own config.

Properties

PropertyTypeDescriptionDefined in
agent?AgentA self-contained agentic loop. Mutually exclusive with base and run — an agent carries its own config and its own loop.channels/dispatcher.types.ts:53
base?DispatcherRunBaseShared run config (model, memory, tools, system, onEvent, hooks, …).channels/dispatcher.types.ts:48
capacity?numberPer-session inbound buffer capacity — the spam ceiling for one session. Default 64.channels/dispatcher.types.ts:58
maxConcurrency?numberMax runs in flight across all sessions — the global protection for the model / provider rate limit. Excess waits. Default 4.channels/dispatcher.types.ts:68
onError?(error, sessionId) => voidCalled when a run rejects for a reason other than a supersede abort. Without it, such an error is swallowed (a single bad run must not kill the dispatcher).channels/dispatcher.types.ts:90
onSessionEvent?(sessionId, event) => voidPer-run event sink that also receives the run's sessionId — the hook a channel bridge needs to route a run's outbound events (e.g. TextDelta) back to the right channel/thread. The session-blind base.onEvent still fires too. Additive: unset, the dispatcher behaves exactly as before.channels/dispatcher.types.ts:84
overflow?OverflowPolicy<Message>What happens to an inbound message when a session's buffer is full. Default "drop-oldest" (stale context is the cheapest to lose under live ingress).channels/dispatcher.types.ts:63
run?RunFnOverride how runs execute (for tests). Default runAgent.channels/dispatcher.types.ts:77
supersede?booleanWhen true, a newly submitted message aborts the in-flight run for that session (supersede) rather than letting it finish and queueing behind it. Safe because runAgent persists the prompt to memory before its first abort check, so a superseded run's messages survive in history. Default false.channels/dispatcher.types.ts:75

On this page