BoundaryML/baml · error

ObjectValue is not yet supported:

Error message

ObjectValue is not yet supported: 

What it means

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.

Source

Thrown at engine/language_client_go/baml_go/serde/decode.go:593

		return val, reflect.TypeOf(false)
	case *cffi.CFFIValueHolder_ClassValue:
		return decodeClassValue(value.ClassValue, typeMap)
	case *cffi.CFFIValueHolder_EnumValue:
		return decodeEnumValue(value.EnumValue, typeMap)
	case *cffi.CFFIValueHolder_ListValue:
		return decodeListValue(value.ListValue, typeMap)
	case *cffi.CFFIValueHolder_MapValue:
		return decodeMapValue(value.MapValue, typeMap)
	case *cffi.CFFIValueHolder_UnionVariantValue:
		return decodeUnionValue(value.UnionVariantValue, typeMap)
	case *cffi.CFFIValueHolder_CheckedValue:
		return decodeCheckedValue(value.CheckedValue, typeMap)
	case *cffi.CFFIValueHolder_StreamingStateValue:
		return decodeStreamingStateValue(value.StreamingStateValue, typeMap)
	case *cffi.CFFIValueHolder_LiteralValue:
		return decodeLiteralValue(value.LiteralValue, typeMap)
	case *cffi.CFFIValueHolder_ObjectValue:
		panic("ObjectValue is not yet supported: " + holder.String())
	default:
		panic("error decoding value: " + holder.String())
	}
}

func decodeLiteralValue(valueLiteral *cffi.CFFIFieldTypeLiteral, _ TypeMap) (reflect.Value, reflect.Type) {
	if valueLiteral == nil {
		panic("decodeLiteralValue: valueLiteral is nil")
	}

	switch value := valueLiteral.Literal.(type) {
	case *cffi.CFFIFieldTypeLiteral_BoolLiteral:
		return reflect.ValueOf(value.BoolLiteral.Value), reflect.TypeOf(false)
	case *cffi.CFFIFieldTypeLiteral_IntLiteral:
		return reflect.ValueOf(value.IntLiteral.Value), reflect.TypeOf(int64(0))
	case *cffi.CFFIFieldTypeLiteral_StringLiteral:
		return reflect.ValueOf(value.StringLiteral.Value), reflect.TypeOf("")
	default:

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Upgrade the baml Go runtime to a version where ObjectValue decoding is implemented (go get -u github.com/boundaryml/baml/...)
  2. Change the function's return type in the .baml file to a concrete class/map shape the Go runtime supports, then regenerate
  3. If the object comes from a nested field, restructure the output schema so values are classes or maps rather than opaque objects
  4. Capture the panic's holder.String() dump and verify with baml maintainers whether ObjectValue is expected for your output type

Example fix

// before (baml): opaque object output
function GetData() object { ... }

// after: use a concrete class the Go runtime can decode
class DataRecord {
  id string
  score float
}
function GetData() DataRecord { ... }
// then baml-cli generate
Defensive patterns

Strategy: validation

Validate before calling

// Ensure no function in baml_src declares an opaque object return
go b, err := os.ReadFile("b/baml_src/functions.baml")
if err == nil && strings.Contains(string(b), "() object") {
	return errors.New("opaque object return types unsupported by go client — use a concrete class")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/fcf33877d46b3f30. Report an issue: GitHub.