Repository navigation
fix(cli): close connection and discovery probes before their loops exit - #153
Merged
n-papaioannou merged 2 commits intoOct 5, 2026
Conversation
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
rudycelekli
requested review from
Sebabaian,
dimneo,
n-papaioannou and
stefyi-4355
as code owners
October 4, 2026 06:45
n-papaioannou
approved these changes
Oct 5, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What and why
The CLI creates a provider for its connection probe and optional discovery probe. Their aiohttp sessions survive after the temporary asyncio.run event loops close. Close CLI-owned probe resources inside the loop that opened them, using the existing best-effort provider cleanup helper. Cancellation is preserved.
Native reproduction and verification
A real local HTTP server and CliRunner invocation reproduced an open aiohttp session after the command returned: one regression failed before the fix. The new CLI regression and actual-session cancellation control both pass (2 passed). Synthetic credentials, customer_support B01, fixture grounding and the mock judge are used; no paid provider is contacted. The command writes its JSON report and returns exit 2 for the intentionally partial/inconclusive inspection, which is not a complete successful scorecard.
Required gates passed: Ruff on ifixai, Bandit medium/high scan, layout validation and all eleven example fixtures. Advisory Mypy reports the same four pre-existing CLI errors on the base and patched source; the helper introduces none. Full unrelated inspection execution is not claimed.
Scope
This fixes CLI-owned probe lifetime only. The public inspection API keeps its existing provider ownership behavior.
Prepared with AI assistance and reviewed before publication.