Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a standing issue fix: #331
We successfully fixed the issue where subgroups didn't work correctly when parameters were provided through config files. The core problem was that when subgroup parameters were specified in a YAML file, they
couldn't be properly associated with their parent subgroup type.
The Fix
The solution involved two main components:
- Added code to detect when fields in a config file match fields in a subgroup's default type
- When matching fields are found, they're automatically associated with the correct subgroup
- This happens in both dataclass_wrapper.py and parsing.py when processing configs
- Enhanced how we handle functions and functools.partial objects in subgroups
- Added robust resolution of return type annotations to better support nested class definitions
- Fixed edge cases with string annotations by evaluating them in the correct scope
Before vs After
Before:
After:
Both approaches now work equivalently:
CLI args
Config file
The fix preserves backward compatibility while adding the ability to specify subgroup parameters directly in config files without explicit nesting, making the API more intuitive and consistent.
Mostly authored by Claude Code 3.7