{"record":{"id":"f2474b69b4349863","repo":"BoundaryML/baml","slug":"no-parsed-result-available-from-function-call-repl","errorCode":null,"errorMessage":"No parsed result available from function call","messagePattern":"No parsed result available from function call","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/cli/repl.rs","lineNumber":599,"sourceCode":"                            if let LLMResponse::Success(resp) = function_result.llm_response() {\n                                let usage = TokenUsage {\n                                    prompt_tokens: resp.metadata.prompt_tokens,\n                                    output_tokens: resp.metadata.output_tokens,\n                                    total_tokens: resp.metadata.total_tokens,\n                                    cached_input_tokens: resp.metadata.cached_input_tokens,\n                                };\n                                let _ = tx.send(LlmStatusEvent::Finished(run_id, Some(usage)));\n                            } else {\n                                let _ = tx.send(LlmStatusEvent::Finished(run_id, None));\n                            }\n                        }\n                        match function_result.parsed() {\n                            Some(Ok(response_baml_value)) => Ok(response_baml_value\n                                .clone()\n                                .0\n                                .map_meta_owned(|_| (Span::fake(), None))),\n                            Some(Err(e)) => Err(anyhow!(\"Failed to parse function result: {}\", e)),\n                            None => Err(anyhow!(\"No parsed result available from function call\")),\n                        }\n                    }\n                    None => Err(anyhow!(\n                        \"No runtime loaded, it should be impossible to call an LLM function\"\n                    )),\n                }\n            }\n        };\n        // REPL watch handler: collect notifications\n        let watch_notifications = Arc::new(Mutex::new(Vec::new()));\n        let watch_notifications_clone = watch_notifications.clone();\n        let watch_handler = shared_handler(move |notification| {\n            watch_notifications_clone\n                .lock()\n                .unwrap()\n                .push(format!(\"{notification}\"));\n        });\n","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/cli/repl.rs#L581-L617","documentation":"The REPL requires that every completed LLM function call yields a parsed result; when parsed() returns None the call produced no parse outcome at all, so evaluation fails with this invariant-style error. Unlike 912 this is not a parse failure — no parsing was even attempted or recorded.","triggerScenarios":"function_result.parsed() returns None after a function call — the function runtime returned a result object without a parsed payload (e.g. call errored upstream, streaming result not finalized, or result not yet available).","commonSituations":"LLM call failed before producing output, using a runtime/function combo that does not populate the parsed field, internal state issues in the REPL runtime.","solutions":["Check earlier LLM status events/logs for an upstream call failure and fix that first","Retry the function call — often transient (rate limit, timeout upstream)","Verify the function runs correctly via the BAML CLI/VS Code playground","Report as a bug if the call visibly succeeded but parsed() is still None"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match result { Err(e) if e.to_string().contains(\"No parsed result\") => { /* check status events/logs, then retry once */ }, Ok(v) => Ok(v), Err(e) => Err(e) }","preventionTips":["Watch LlmStatusEvent stream for upstream failures before result read","Retry once on this error — often a transient upstream call failure","Validate the same function works via the BAML CLI","Report persistent occurrences as a runtime bug"],"tags":["repl","baml","llm-output","missing-result"],"backgroundTag":"empty-api-response","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}