diff --git a/replit_river/codegen/client.py b/replit_river/codegen/client.py index 541471b..0447e56 100644 --- a/replit_river/codegen/client.py +++ b/replit_river/codegen/client.py @@ -193,7 +193,7 @@ def flatten_union(tpe: RiverType) -> list[RiverType]: """.strip() ) if local_discriminators: - local_discriminator = local_discriminators.pop() + local_discriminator = sorted(local_discriminators).pop() else: local_discriminator = "FIXME: Ambiguous discriminators" typeddict_encoder.append(