config: merge_config silently ignores type mismatches #76

Closed
opened 2026-07-05 13:37:52 +00:00 by the.auditor · 0 comments
Owner

merge_config in src/kronai/config.py:57 assigns override values directly without type validation. Passing a string for default_temperature (which expects float) would succeed at runtime since dataclasses don't enforce types.

Consider wrapping KronaiConfig(**vals) in a try/except TypeError and raising ConfigError to catch accidental misuse early.

From PR #73 review suggestion.

`merge_config` in `src/kronai/config.py:57` assigns override values directly without type validation. Passing a string for `default_temperature` (which expects `float`) would succeed at runtime since dataclasses don't enforce types. Consider wrapping `KronaiConfig(**vals)` in a `try/except TypeError` and raising `ConfigError` to catch accidental misuse early. _From PR #73 review suggestion._
fuzzy closed this issue 2026-07-05 16:09:07 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/kronai#76
No description provided.