Skip to content

fix(cli): close connection and discovery probes before their loops exit - #153

Merged
n-papaioannou merged 2 commits into
ifixai-ai:mainfrom
rudycelekli:fix/ifix-probe-session-lifetime-20261004
Oct 5, 2026
Merged

n-papaioannou merged 2 commits into
ifixai-ai:mainfrom
rudycelekli:fix/ifix-probe-session-lifetime-20261004

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

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.

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
@n-papaioannou
n-papaioannou merged commit e9788b7 into ifixai-ai:main Oct 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants