{"record":{"id":"d805e21009df3a39","repo":"BoundaryML/baml","slug":"execution-node-out-of-bounds-raw-curl-for-client","errorCode":null,"errorMessage":"Execution Node out of bounds (raw curl): {} >= {} for client {}","messagePattern":"Execution Node out of bounds \\(raw curl\\): (.+?) >= (.+?) for client (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/lib.rs","lineNumber":938,"sourceCode":"        &self,\n        function_name: &str,\n        ctx: &RuntimeContext,\n        prompt: &[internal_baml_jinja::RenderedChatMessage],\n        render_settings: RenderCurlSettings,\n        node_index: Option<usize>,\n    ) -> Result<String> {\n        let func = self.get_function(function_name)?;\n        let renderer = PromptRenderer::from_function(&func, self.ir(), ctx)?;\n\n        let client_spec = renderer.client_spec();\n        let client = self.get_llm_provider_impl(client_spec, ctx)?;\n        let mut selected =\n            client.iter_orchestrator(&mut Default::default(), Default::default(), ctx, self)?;\n\n        let node_index = node_index.unwrap_or(0);\n\n        if node_index >= selected.len() {\n            return Err(anyhow::anyhow!(\n                \"Execution Node out of bounds (raw curl): {} >= {} for client {}\",\n                node_index,\n                selected.len(),\n                client_spec,\n            ));\n        }\n\n        let node = selected.swap_remove(node_index);\n        node.provider\n            .render_raw_curl(ctx, prompt, render_settings)\n            .await\n    }\n\n    pub async fn run_test_with_expr_events<F, G>(\n        &self,\n        function_name: &str,\n        test_name: &str,\n        ctx: &RuntimeContextManager,","sourceCodeStart":920,"sourceCodeEnd":956,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/lib.rs#L920-L956","documentation":"Thrown by render_raw_curl_impl when the requested orchestrator execution node index is beyond the number of nodes the orchestrator actually selected for the client. Raw-curl rendering can target a specific execution node; here node_index (defaulting to 0) is compared against selected.len() and rejected with both bounds and the client spec. It guards against indexing out of the orchestrator's candidate list.","triggerScenarios":"Calling render_raw_curl with node_index = Some(n) where n >= number of orchestrator nodes selected for the resolved LLM client (selected.len() == 0 also fails for any index, including the default 0).","commonSituations":"Requesting an alternate fallback/shard node that does not exist because no retry/fallback strategy is configured; the client resolved to a single node but a higher node_index was passed; client configuration changed so fewer orchestrator nodes are produced than the tooling assumes.","solutions":["Pass a node_index less than the number of orchestrator nodes (or omit it to use node 0)","Inspect the client's retry/fallback strategy in .baml to know how many execution nodes exist","If selected.len() is 0, fix the client configuration so the orchestrator produces at least one node","Handle the error in tooling by clamping node_index or enumerating nodes before rendering"],"exampleFix":"// before\nlet curl = runtime.render_raw_curl(\"MyFunc\", &ctx, &prompt, settings, Some(3)).await?;\n// after\nlet idx = 3.min(node_count.saturating_sub(1)); // or None for the first node\nlet curl = runtime.render_raw_curl(\"MyFunc\", &ctx, &prompt, settings, Some(idx)).await?;","handlingStrategy":"validation","validationCode":"// Clamp node_index before calling raw curl rendering\nlet idx = match node_index {\n    Some(i) if i < selected_len => i,\n    _ => 0,\n};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Know the orchestrator node count implied by your retry/fallback strategy","Default to node_index = 0 (or None) unless targeting a specific fallback node","Guard tooling code against empty orchestrator selections"],"tags":["index-out-of-bounds","raw-curl","orchestrator","rust"],"backgroundTag":"index-out-of-bounds","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}