Commit 73d048a
committed
Prevent profile from being overridden by defaults
Previously, when loading a custom profile via --profile, its settings
could be overridden by defaults from the initial Profile() instance
because argparse was initialized with those defaults, and
only None-valued arguments would be updated from the custom profile.
This caused issues like custom model settings being reset to the default
claude-3-5-sonnet-20241022.
This change:
- Creates a fresh Profile instance when loading custom profiles
- Tracks which arguments were explicitly provided via CLI
- Updates args from profile unless explicitly set via CLI
This ensures profile settings take precedence over defaults while
still allowing CLI arguments to override profile settings.
Example:
Before: Custom profile with model="gpt-4o-mini" would be overridden
by default model="claude-3-5-sonnet-20241022" unless --model was
explicitly set on command line.
After: Custom profile settings are preserved unless explicitly
overridden by command line arguments.
The provider auto-detection still works as expected:
- If profile sets both model and provider: uses those values
- If profile sets only model: provider=None allows auto-detection1 parent 30ec1e9 commit 73d048a
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
278 | 279 | | |
279 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
280 | 286 | | |
281 | | - | |
| 287 | + | |
282 | 288 | | |
283 | 289 | | |
284 | 290 | | |
| |||
0 commit comments