Repository navigation
Commit 9202dc4
committed
Fix dump_config when a model field is None (e.g. fallback_model)
VibeConfig.dump_config used to call tomli_w.dump on the raw dict
returned by model_dump(); tomli_w cannot serialize Python None.
Pydantic's to_jsonable_python(exclude_none=True) only drops Nones
from Pydantic models, not from plain dicts. Add a recursive
_strip_none helper used by dump_config so any Optional[...] field
with a None default round-trips through the TOML file cleanly.
Triggered by the new ModelConfig.fallback_model: str | None field
which broke 21 tests under tests/acp/ that round-trip a config.1 parent 0a8c815 commit 9202dc4
1 file changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
344 | 356 | | |
345 | 357 | | |
346 | 358 | | |
| |||
635 | 647 | | |
636 | 648 | | |
637 | 649 | | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
638 | 656 | | |
639 | | - | |
| 657 | + | |
640 | 658 | | |
641 | 659 | | |
642 | 660 | | |
| |||
0 commit comments