Skip to content

fix: Avoid init failures#2088

Draft
jooooonas wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
p-doom:fix/dataclass-config-roundtrip
Draft

fix: Avoid init failures#2088
jooooonas wants to merge 1 commit into
PrimeIntellect-ai:mainfrom
p-doom:fix/dataclass-config-roundtrip

Conversation

@jooooonas

@jooooonas jooooonas commented Jul 21, 2026

Copy link
Copy Markdown

Fix init failures by excluding non-constructor fields in env_config_data serialization

  • Adds a _constructor_excludes helper in pool.py that recursively builds a Pydantic exclude tree, skipping dataclass fields with init=False and recursing into nested dataclasses, BaseModel instances, mappings, and sequences.
  • env_config_data now passes this exclude tree to model_dump before filtering to EnvConfig.model_fields, preventing fields that cannot be passed to constructors from appearing in the serialized output.
  • Behavioral Change: model_dump output for nested config objects will now omit init=False fields that were previously included.

Macroscope summarized c14c5fa.

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.

1 participant