{"record":{"id":"88b9b199ce5cc630","repo":"BoundaryML/baml","slug":"internal-failure-message-this-should-not-happen-please","errorCode":null,"errorMessage":"Internal Failure: {message}.\nThis should not happen - please report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience.","messagePattern":"Internal Failure: (.+?)\\.\nThis should not happen - please report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"engine/baml-runtime/src/types/response.rs","lineNumber":153,"sourceCode":"                            crate::internal::llm_client::ErrorCode::Other(2) => {\n                                Err(anyhow::anyhow!(err.message.clone()))\n                            }\n                            _ => Err(anyhow::anyhow!(\n                                crate::errors::ExposedError::ClientHttpError {\n                                    client_name: err.client.clone(),\n                                    message: err.message.clone(),\n                                    status_code: err.code.clone(),\n                                    detailed_message: err.message.clone(),\n                                    raw_response: err.raw_response.clone(),\n                                }\n                            )),\n                        }\n                    }\n                    LLMResponse::UserFailure(message) => {\n                        Err(anyhow::anyhow!(\"User Failure: {message}.\\nPlease report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience.\"))\n                    }\n                    LLMResponse::InternalFailure(message) => {\n                        Err(anyhow::anyhow!(\"Internal Failure: {message}.\\nThis should not happen - please report this error to our team with BAML_LOG=info enabled so we can catch this error earlier and improve your development experience.\"))\n                    }\n                    LLMResponse::Cancelled(message) => {\n                        Err(anyhow::anyhow!(crate::errors::ExposedError::AbortError {\n                            detailed_message: message.clone(),\n                        }))\n                    }\n                    LLMResponse::Success(_) => {\n                        Err(anyhow::anyhow!(\"This should never happen - Please report this error to our team with BAML_LOG=info enabled so we can improve this error message\"))\n                    }\n                };\n        };\n\n        result\n    }\n\n    fn format_last_error_with_details(&self, last_error: &anyhow::Error) -> ExposedError {\n        let detailed_message = self.create_detailed_message();\n","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/types/response.rs#L135-L171","documentation":"When the chain's LLMResponse is InternalFailure, result_with_constraints_content raises an error stating this should never happen and asks the user to report it with BAML_LOG=info. It marks an internal BAML runtime failure — a bug or unexpected state, not a user error.","triggerScenarios":"The runtime recorded LLMResponse::InternalFailure (internal panics/invariant breaks during orchestration or streaming) and result_with_constraints_content is then called.","commonSituations":"BAML runtime bugs, corrupted streaming state, version incompatibilities between generated client code and the runtime.","solutions":["Re-run with BAML_LOG=info (or debug) and capture the trace.","Update BAML runtime and generated code to matching versions.","Report the issue to the BAML team with the log output, as the message instructs.","As a workaround, catch the error and retry the function call."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match chain.content() {\n    Ok(v) => Ok(v),\n    Err(e) if e.to_string().starts_with(\"Internal Failure:\") => {\n        report_bug_with_baml_log(&e);\n        retry_or_default()\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Keep the BAML runtime and generated clients on identical versions","Reproduce internal failures with BAML_LOG=debug and report them upstream","Wrap BAML calls so internal failures degrade gracefully"],"tags":["internal","bug","baml-runtime"],"backgroundTag":"internal-invariant-violation","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"}