Skip to content

fix: instantiate ModelConfigOverrides records without no-arg ctor (#2493) - #2653

Open
vikas-prasad-cx wants to merge 1 commit into
TimefoldAI:mainfrom
vikas-prasad-cx:fix/2493-empty-instances
Open

vikas-prasad-cx wants to merge 1 commit into
TimefoldAI:mainfrom
vikas-prasad-cx:fix/2493-empty-instances

Conversation

@vikas-prasad-cx

Copy link
Copy Markdown
Contributor

Summary

  • Add EmptyInstances so the Service SDK can create empty class/record instances at build time (no-arg constructor for classes; canonical constructor with null/primitive defaults for records).
  • Wire DefaultConfigProfileProcessor to use it instead of requiring getDeclaredConstructor().newInstance().
  • Convert the default-config testdata ModelConfigOverrides to a record with no dummy all-null constructor, proving models can drop that boilerplate.
  • Add EmptyInstancesTest coverage for classes, records, primitives, and compact constructors.

Fixes #2493

Test plan

  • ./mvnw test -pl service/quarkus/deployment -Dtest=EmptyInstancesTest (5 tests passed)
  • ./mvnw test -pl service/quarkus/deployment -Dtest=DefaultConfigProfileTest (passed; record without no-arg constructor)
  • ./mvnw test -pl service/quarkus/deployment (49 tests passed, 0 failures)
  • CI checks on this PR

Made with Cursor

…mefoldAI#2493)

Allow empty record instances via the canonical constructor so models no
longer need an all-null no-arg constructor for default config profiles.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service SDK: ModelConfigOverrides records are forced to declare an all-null no-arg constructor

1 participant