{"record":{"id":"8dc3107bba7812e4","repo":"BoundaryML/baml","slug":"failed-to-get-request-id-w","errorCode":null,"errorMessage":"failed to get request id: %w","messagePattern":"failed to get request id: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/pkg/rawobjects_llm_call.go","lineNumber":30,"sourceCode":"\t*raw_objects.RawObject\n}\n\nfunc newLLMCall(ptr int64, rt unsafe.Pointer) LLMCall {\n\treturn &llmCall{raw_objects.FromPointer(ptr, rt)}\n}\n\nfunc (l *llmCall) ObjectType() cffi.BamlObjectType {\n\treturn cffi.BamlObjectType_OBJECT_LLM_CALL\n}\n\nfunc (l *llmCall) pointer() int64 {\n\treturn l.RawObject.Pointer()\n}\n\nfunc (l *llmCall) RequestId() (string, error) {\n\tresult, err := raw_objects.CallMethod(l, \"http_request_id\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get request id: %w\", err)\n\t}\n\n\treturn result.(string), nil\n}\n\nfunc (l *llmCall) ClientName() (string, error) {\n\tresult, err := raw_objects.CallMethod(l, \"client_name\", nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get client name: %w\", err)\n\t}\n\n\tname, ok := result.(string)\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unexpected type for client name: %T\", result)\n\t}\n\n\treturn name, nil\n}","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/pkg/rawobjects_llm_call.go#L12-L48","documentation":"Thrown by llmCall.RequestId() in BAML's Go client when raw_objects.CallMethod(l, \"http_request_id\") fails at the FFI boundary; the core error is wrapped with %w. It means the LLM call object could not serve its associated HTTP request id, typically because the call has no linked HTTP request or the raw object handle is invalid.","triggerScenarios":"Calling LLMCall.RequestId() on an llmCall raw object for which the core cannot resolve http_request_id — e.g. calls that never issued an HTTP request (client-side failures), stale pointers, or bindings/core version drift.","commonSituations":"Inspecting failed or synthetic LLM calls in BAML event logs that have no underlying HTTP request; accessing call metadata after runtime teardown; version-mismatched installations.","solutions":["Unwrap the error to see the core-side reason (likely 'no http request' for failed calls)","Check LLMCall.HttpRequest() first; if it returns nil the call never made an HTTP request and has no request id","Only read RequestId() on completed calls with an attached HTTPRequest/HTTPResponse","Align Go bindings and BAML core versions"],"exampleFix":"id, err := llmCall.RequestId()\nif err != nil {\n    // failed calls may have no http_request_id\n    if _, hErr := llmCall.HttpRequest(); hErr != nil {\n        return \"\", fmt.Errorf(\"call has no http request: %w\", err)\n    }\n    return \"\", err\n}","handlingStrategy":"validation","validationCode":"if _, err := llmCall.HttpRequest(); err != nil {\n    // no associated http request; skip RequestId()\n}","typeGuard":null,"tryCatchPattern":"id, err := llmCall.RequestId()\nif err != nil {\n    log.Printf(\"no request id for this call (possibly a failed call): %v\", err)\n    id = \"\"\n}","preventionTips":["Verify the call has an HTTPRequest before reading its request id","Only inspect request ids on completed LLM calls","Keep baml engine and Go bindings on matching versions"],"tags":["go","ffi","baml","method-call"],"backgroundTag":"api-request-failed","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"}