{"record":{"id":"fcf33877d46b3f30","repo":"BoundaryML/baml","slug":"objectvalue-is-not-yet-supported","errorCode":null,"errorMessage":"ObjectValue is not yet supported: ","messagePattern":"ObjectValue is not yet supported: ","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/language_client_go/baml_go/serde/decode.go","lineNumber":593,"sourceCode":"\t\treturn val, reflect.TypeOf(false)\n\tcase *cffi.CFFIValueHolder_ClassValue:\n\t\treturn decodeClassValue(value.ClassValue, typeMap)\n\tcase *cffi.CFFIValueHolder_EnumValue:\n\t\treturn decodeEnumValue(value.EnumValue, typeMap)\n\tcase *cffi.CFFIValueHolder_ListValue:\n\t\treturn decodeListValue(value.ListValue, typeMap)\n\tcase *cffi.CFFIValueHolder_MapValue:\n\t\treturn decodeMapValue(value.MapValue, typeMap)\n\tcase *cffi.CFFIValueHolder_UnionVariantValue:\n\t\treturn decodeUnionValue(value.UnionVariantValue, typeMap)\n\tcase *cffi.CFFIValueHolder_CheckedValue:\n\t\treturn decodeCheckedValue(value.CheckedValue, typeMap)\n\tcase *cffi.CFFIValueHolder_StreamingStateValue:\n\t\treturn decodeStreamingStateValue(value.StreamingStateValue, typeMap)\n\tcase *cffi.CFFIValueHolder_LiteralValue:\n\t\treturn decodeLiteralValue(value.LiteralValue, typeMap)\n\tcase *cffi.CFFIValueHolder_ObjectValue:\n\t\tpanic(\"ObjectValue is not yet supported: \" + holder.String())\n\tdefault:\n\t\tpanic(\"error decoding value: \" + holder.String())\n\t}\n}\n\nfunc decodeLiteralValue(valueLiteral *cffi.CFFIFieldTypeLiteral, _ TypeMap) (reflect.Value, reflect.Type) {\n\tif valueLiteral == nil {\n\t\tpanic(\"decodeLiteralValue: valueLiteral is nil\")\n\t}\n\n\tswitch value := valueLiteral.Literal.(type) {\n\tcase *cffi.CFFIFieldTypeLiteral_BoolLiteral:\n\t\treturn reflect.ValueOf(value.BoolLiteral.Value), reflect.TypeOf(false)\n\tcase *cffi.CFFIFieldTypeLiteral_IntLiteral:\n\t\treturn reflect.ValueOf(value.IntLiteral.Value), reflect.TypeOf(int64(0))\n\tcase *cffi.CFFIFieldTypeLiteral_StringLiteral:\n\t\treturn reflect.ValueOf(value.StringLiteral.Value), reflect.TypeOf(\"\")\n\tdefault:","sourceCodeStart":575,"sourceCodeEnd":611,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/language_client_go/baml_go/serde/decode.go#L575-L611","documentation":"Decode's top-level switch explicitly panics when it receives a CFFIValueHolder_ObjectValue. ObjectValue is a placeholder variant in the CFFI protocol that the Go serde has not implemented, so any engine response carrying an object value cannot be decoded into a Go value and fails fast.","triggerScenarios":"A BAML function result (or nested value inside a list/map/union) is represented by the engine as an ObjectValue — e.g. raw object outputs or newer engine features that emit ObjectValue instead of ClassValue — while using a Go client whose Decode has no ObjectValue branch.","commonSituations":"Using engine features like dynamic/raw object returns with an older generated Go client; calling functions whose output type the Go runtime maps to a generic object; upgrading the engine but not the Go runtime.","solutions":["Upgrade the baml Go runtime to a version where ObjectValue decoding is implemented (go get -u github.com/boundaryml/baml/...)","Change the function's return type in the .baml file to a concrete class/map shape the Go runtime supports, then regenerate","If the object comes from a nested field, restructure the output schema so values are classes or maps rather than opaque objects","Capture the panic's holder.String() dump and verify with baml maintainers whether ObjectValue is expected for your output type"],"exampleFix":"// before (baml): opaque object output\nfunction GetData() object { ... }\n\n// after: use a concrete class the Go runtime can decode\nclass DataRecord {\n  id string\n  score float\n}\nfunction GetData() DataRecord { ... }\n// then baml-cli generate","handlingStrategy":"validation","validationCode":"// Ensure no function in baml_src declares an opaque object return\ngo b, err := os.ReadFile(\"b/baml_src/functions.baml\")\nif err == nil && strings.Contains(string(b), \"() object\") {\n\treturn errors.New(\"opaque object return types unsupported by go client — use a concrete class\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use concrete class or map output types instead of opaque object returns","Upgrade the Go runtime if ObjectValue support ships in a newer release","Regenerate the client whenever output schemas change"],"tags":["go","ffi","deserialization","unsupported","baml"],"backgroundTag":"unsupported-operation","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"}