Expand description
Router configuration — loading, defaults, and model map.
Structs§
- Router
Config - Router configuration.
Constants§
- DEFAULT_
AGENTS - Default agents to check in PATH.
- MAX_
ROUTER_ TIMEOUT_ SECS - Upper bound for router LLM timeout (seconds).
Functions§
- degraded_
rate_ limit_ threshold - Minimum number of rate-limit events within the health check window to consider an agent degraded.
- get_
agent_ backoff_ base - Return the configured base backoff (seconds) for an agent.
- health_
check_ window_ hours - Lookback window (in hours) for the pre-emptive agent health check.
- max_
tasks_ per_ routing_ tick - Maximum number of tasks to route per tick. Prevents blocking the tick loop when multiple tasks are queued simultaneously (e.g., cron jobs). Each routing operation involves an LLM call taking 10-45 seconds, so routing N tasks sequentially would block for N×LLM-latency seconds.
- min_
healthy_ agents_ threshold - Minimum healthy agents threshold for graceful degradation. When healthy agents fall below this number, dispatch switches to sequential mode.
- parse_
pool_ entry - Parse an
agent:modelpool entry string, splitting on the first colon. - retry_
base_ delay_ ms - Base delay in milliseconds for exponential backoff between fallback retries.
- retry_
max_ delay_ ms - Maximum delay in milliseconds for exponential backoff between fallback retries.
- sequential_
dispatch_ delay_ ms - Base delay in milliseconds between dispatches in sequential (degraded) mode.