{{ message }}
Repository navigation
Resolve the probatio codec import before the event loop - #183909
Merged
Merged
Conversation
bdraco
approved these changes
Oct 1, 2026
frenck
marked this pull request as draft
October 1, 2026 15:01
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix addresses the reported blocking import and includes appropriate regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Preloads Probatio’s codec module before Home Assistant starts its event loop, preventing blocking import warnings.
Changes:
- Resolves
to_field_listduring package initialization. - Adds a clean-interpreter regression test.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
frenck
marked this pull request as ready for review
October 1, 2026 18:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Proposed change
Probatio resolves
to_field_listandto_openapithrough a lazy import ofprobatio.codecson first attribute access. Both are first reached from the event loop, where that import is a blocking call: one renders every config flow form, the other builds the tool schemas for a conversation turn.Resolve them in the package
__init__, where probatio is already configured and which runs long before the loop exists. It costs 3.8 ms on top of importing probatio, andprobatio.codecspulls in no voluptuous of its own, so it is safe beforeinstall_as_voluptuous().The test runs in a clean interpreter, like
test_circular_imports.py. By the time an ordinary test runs, something has already imported the codecs and the assert would pass either way.Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: