Reproduction
Anthropic regeneration PR tryAGI/Anthropic#295 fails its newly restored PR build in run 36287263480 (attempt 2):
Generated/Anthropic.Models.BetaManagedAgentsModelParams.g.cs(45,89): error CS0266: Cannot implicitly convert type 'Anthropic.BetaManagedAgentsModel?' to 'Anthropic.BetaManagedAgentsModel'.
PickBetaManagedAgentsModel() returns the nullable value-type property with ! rather than extracting .Value. The same regenerated PR also removes .Value from the matching System.Text.Json converter. The generator's HasNullableValueVariant(TypeData) in Sources.Models.AnyOf.cs requires IsAnyOfLike, IsEnum, a built-in primitive, or a global::System.* name even when TypeData.IsValueType is true; this custom enum/value type misses those branches.
Expected
Generated named-union pickers and serializers compile for every nullable value-type variant. Add a focused generator regression test with a custom value-type variant, then regenerate Anthropic and validate build and trim. Do not hand-edit Generated/.
Reproduction
Anthropic regeneration PR tryAGI/Anthropic#295 fails its newly restored PR build in run 36287263480 (attempt 2):
PickBetaManagedAgentsModel()returns the nullable value-type property with!rather than extracting.Value. The same regenerated PR also removes.Valuefrom the matching System.Text.Json converter. The generator'sHasNullableValueVariant(TypeData)inSources.Models.AnyOf.csrequiresIsAnyOfLike,IsEnum, a built-in primitive, or aglobal::System.*name even whenTypeData.IsValueTypeis true; this custom enum/value type misses those branches.Expected
Generated named-union pickers and serializers compile for every nullable value-type variant. Add a focused generator regression test with a custom value-type variant, then regenerate Anthropic and validate build and trim. Do not hand-edit
Generated/.