API Reference
DispatcherOptions
Defined in: channels/dispatcher.types.ts:35
Options for a Dispatcher.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
base | DispatcherRunBase | Shared run config (model, memory, tools, system, onEvent, hooks, …). | channels/dispatcher.types.ts:37 |
capacity? | number | Per-session inbound buffer capacity — the spam ceiling for one session. Default 64. | channels/dispatcher.types.ts:42 |
maxConcurrency? | number | Max runs in flight across all sessions — the global protection for the model / provider rate limit. Excess waits. Default 4. | channels/dispatcher.types.ts:52 |
onError? | (error, sessionId) => void | Called 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:74 |
onSessionEvent? | (sessionId, event) => void | Per-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:68 |
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:47 |
run? | RunFn | Override how runs execute (for tests). Default runAgent. | channels/dispatcher.types.ts:61 |
supersede? | boolean | When 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:59 |