{"record":{"id":"a213a590c66cde26","repo":"BoundaryML/baml","slug":"all-ingress-capacities-and-the-response-reservation-must-be","errorCode":null,"errorMessage":"all ingress capacities and the response reservation must be non-zero","messagePattern":"all ingress capacities and the response reservation must be non-zero","errorType":"validation","errorClass":"LimitsError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_lsp_server/src/lsp_ingress.rs","lineNumber":260,"sourceCode":"        Self {\n            normal_items: 256,\n            normal_bytes: 4 * 1024 * 1024,\n            reserved_items: 64,\n            reserved_bytes: 2 * 1024 * 1024,\n            read_items: 128,\n            read_bytes: 2 * 1024 * 1024,\n            control_items: 64,\n            control_bytes: 64 * 1024,\n            outbound_response_items: 256,\n            outbound_response_bytes: 4 * 1024 * 1024,\n            response_reservation_bytes: 16 * 1024,\n        }\n    }\n}\n\n#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]\npub enum LimitsError {\n    #[error(\"all ingress capacities and the response reservation must be non-zero\")]\n    ZeroCapacity,\n    #[error(\"read capacity must fit inside normal capacity\")]\n    ReadExceedsNormal,\n    #[error(\"one response reservation must fit in the outbound byte capacity\")]\n    ResponseReservationTooLarge,\n    #[error(\"combined normal and reserved capacity overflowed usize\")]\n    CapacityOverflow,\n}\n\nimpl IngressLimits {\n    fn validate(self) -> Result<Self, LimitsError> {\n        if self.normal_items == 0\n            || self.normal_bytes == 0\n            || self.reserved_items == 0\n            || self.reserved_bytes == 0\n            || self.read_items == 0\n            || self.read_bytes == 0\n            || self.control_items == 0","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_lsp_server/src/lsp_ingress.rs#L242-L278","documentation":"`LimitsError::ZeroCapacity` from `IngressLimits::validate`. All ingress capacities (item counts and byte capacities, including read capacity) and the single-response byte reservation must be strictly greater than zero; a zero anywhere makes the limits configuration unusable, so validation fails.","triggerScenarios":"Constructing `IngressLimits` with `normal_items == 0`, zero normal byte capacity, zero read capacity, or a zero response reservation, then calling `validate()` (explicitly or via the constructor path).","commonSituations":"Deriving limits from a config value of 0 (e.g. 'unlimited = 0' convention colliding with 'must be non-zero'); copy-pasting a limits literal and leaving a zero field; a caller disabling a channel by zeroing its capacity.","solutions":["Set every capacity and the response reservation to a positive value","If you meant 'unbounded', use the designated unbounded constructor/option instead of 0","Validate limits at startup so a zero fails fast with a clear config error","Audit where limit values come from (config file/env) and clamp zeros to safe defaults"],"exampleFix":"// before\nlet limits = IngressLimits::new(0, 1 << 20, 1 << 12, 1 << 10)?;\n\n// after\nlet limits = IngressLimits::new(64, 1 << 20, 1 << 12, 1 << 10)?;","handlingStrategy":"validation","validationCode":"fn limits_ok(l: &IngressLimits) -> bool {\n    l.normal_items > 0 && l.normal_bytes > 0 && l.read_bytes > 0 && l.response_reservation > 0\n}","typeGuard":null,"tryCatchPattern":"let limits = IngressLimits::new(a, b, c, d)\n    .map_err(|e| match e { LimitsError::ZeroCapacity => ConfigError::new(\"capacities must be > 0\"), other => other.into() })?;","preventionTips":["Never encode 'unlimited' as 0; use explicit unbounded options","Clamp config-sourced capacities to minimum 1","Validate limits at startup, before wiring the ingress"],"tags":["lsp","rust","validation","limits"],"backgroundTag":"invalid-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}