docs/architecture/admission-lanes.md
OmniRoute has two process-local lane systems with different scopes. They are complementary; operators should know which one they are looking at.
chatBodyAdmission.ts)POST /v1/chat/completions. Guards
against heap amplification from large coding-agent bodies (#4380).anonymous — gets its
own lane with CHAT_MAX_HEAVY_IN_FLIGHT capacity, so one session's burst cannot
starve another session's heavyweight slot.OMNIROUTE_CHAT_VIRTUAL_TTL_MS — idle-lane eviction (default 60000)OMNIROUTE_CHAT_VIRTUAL_MAX_SESSIONS — lane count cap (default 64)OMNIROUTE_CHAT_ADMISSION_QUEUE_MS — queue-wait before 503 (default 2000)OMNIROUTE_CHAT_ADMISSION_MAX_QUEUED_BYTES — queued-bytes heap valve (default 4 MB)GET /api/monitoring/health today; observable via
PerConnectionAdmissionController.snapshot() (sessionId hash, activeHeavy, idleMs).open-sse/services/admission)OMNIROUTE_CHAT_VIRTUAL_LANES=true. Without it,
the adaptive controller keeps the shared queue behavior (criterion 1 of #9654 only
holds once an operator enables lanes).OMNIROUTE_CHAT_VIRTUAL_LANES + adaptive config (maxQueueCount,
maxQueueCost, defaultMaxWaitMs, …).GET /api/monitoring/health → adaptiveAdmission → laneCount,
laneQueuedCount, laneQueuedCost, laneTenants (opaque lane IDs, never raw
keys), and virtualLanes — the authoritative "lanes are on" flag in the snapshot.Combo (priority / round-robin) and fusion fan out N model targets under one parent
request. Since #9654 Wave 2, each fan-out target is gated before dispatch by a
per-target probe (PerTargetAdmissionHook, built by createPerTargetAdmissionHook)
against the parent's tenant lane.
OMNIROUTE_CHAT_VIRTUAL_LANES
is unset — the parent request already holds the shared-queue lease in that mode,
so probing would double-count and reject combo targets.maxWaitMs 0: a full lane
skips the target and the combo's fallback machinery (or fusion's survivor
panel) serves instead. This is deliberate: a fan-out target is redundant
work, and queueing it piles more load onto the exact congestion lanes exist
to stop. defaultMaxWaitMs therefore applies to the parent request only;
fan-out probes never wait, and there is intentionally no knob to make
them wait (issue history shows wait knobs produced the mass-502/504 class
#9654 prevents — revisit only if an operator reports skipped fan-out targets
hurting response quality).stream
flag, exactly like the parent path — so fusion panel members (stream: false)
are priced at the non-streaming class they will truly occupy, and priority/RR
targets at whatever the user requested.fallbackCount (mirroring the existing fallback semantics; visible in combo
logs); fusion returns 503 when every panel member is skipped. There is
no aggregate counter (e.g. virtualFanoutSkipped) on the snapshot today —
if an operator reports they cannot tell how often the lane gate skips fan-out
targets, that is the trigger to add one.adaptiveAdmission.laneCount / laneTenants → adaptive virtual lanes (system 2).adaptiveAdmission.virtualLanes === true → the fan-out probes of section 3 are
also active. A payload with virtualLanes missing or false means
OMNIROUTE_CHAT_VIRTUAL_LANES is unset — the byte-level lanes (system 1) are
still active, but nothing under adaptiveAdmission (and no fan-out gating) is
in effect until it is enabled.The byte-level lanes bound the memory-heavy parse/compress path; the adaptive lanes bound dispatch cost per tenant. #9654's criterion 1 ("one session's burst does not 503 another") is enforced by system 1 unconditionally and by system 2 once opt-in is enabled.