BoundaryML/baml · error · LimitsError
one response reservation must fit in the outbound byte capac
Error message
one response reservation must fit in the outbound byte capacity
What it means
`LimitsError::ResponseReservationTooLarge`. Each in-flight response reserves bytes from the outbound byte capacity; that per-response reservation must fit within the total outbound byte capacity, otherwise even a single response could not be admitted. Validation rejects such limits.
Source
Thrown at baml_language/crates/baml_lsp_server/src/lsp_ingress.rs:264
reserved_bytes: 2 * 1024 * 1024,
read_items: 128,
read_bytes: 2 * 1024 * 1024,
control_items: 64,
control_bytes: 64 * 1024,
outbound_response_items: 256,
outbound_response_bytes: 4 * 1024 * 1024,
response_reservation_bytes: 16 * 1024,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum LimitsError {
#[error("all ingress capacities and the response reservation must be non-zero")]
ZeroCapacity,
#[error("read capacity must fit inside normal capacity")]
ReadExceedsNormal,
#[error("one response reservation must fit in the outbound byte capacity")]
ResponseReservationTooLarge,
#[error("combined normal and reserved capacity overflowed usize")]
CapacityOverflow,
}
impl IngressLimits {
fn validate(self) -> Result<Self, LimitsError> {
if self.normal_items == 0
|| self.normal_bytes == 0
|| self.reserved_items == 0
|| self.reserved_bytes == 0
|| self.read_items == 0
|| self.read_bytes == 0
|| self.control_items == 0
|| self.control_bytes == 0
|| self.outbound_response_items == 0
|| self.outbound_response_bytes == 0
|| self.response_reservation_bytes == 0View on GitHub (pinned to bd85ce9dee)
Solutions
- Increase the outbound byte capacity so at least one reservation fits
- Decrease the per-response reservation to be <= outbound byte capacity
- Recompute reservation and outbound capacity together when changing message size limits
- Validate at startup and log all limit values for diagnosability
Example fix
// before: reservation larger than outbound capacity let limits = IngressLimits::new(items, normal_bytes, read_bytes, /*reservation*/ 4 << 20, /*outbound*/ 1 << 20)?; // after: reservation fits let limits = IngressLimits::new(items, normal_bytes, read_bytes, /*reservation*/ 1 << 20, /*outbound*/ 4 << 20)?;
Defensive patterns
Strategy: validation
Validate before calling
fn reservation_fits(reservation: usize, outbound: usize) -> bool { reservation <= outbound } Try / catch
let reservation = reservation.min(outbound_bytes); let limits = IngressLimits::new(items, normal_bytes, read_bytes, reservation, outbound_bytes)?;
Prevention
- Recompute reservation whenever outbound capacity changes
- Keep reservation <= outbound/2 so multiple responses can be in flight
- Document units for both fields to avoid byte/KiB confusion
When it happens
Trigger: Constructing `IngressLimits` where the per-response byte reservation is greater than the outbound byte capacity, then validating.
Common situations: Raising the reservation to accommodate large responses while leaving the outbound byte budget small; unit confusion (e.g. reserving in bytes but configuring outbound in KiB); a default reservation kept after shrinking outbound capacity.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- all ingress capacities and the response reservation must be
- read capacity must fit inside normal capacity
- combined normal and reserved capacity overflowed usize
- dependency name `{name}` is reserved
- {0}
AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12).
Data as JSON: /api/errors/4e86aab03cfb1338.
Report an issue: GitHub.