fix(tui): extract @token text correctly in on_input_submitted suggestions query #11226

Closed
HAL9000 wants to merge 4 commits from fix-11004-tui-suggestions into master
5 changed files with 291 additions and 4 deletions
+7
View File
1
@@ -7,6 +7,13 @@ Changed `wf10_batch.robot` to be less likely to create files, and
## [Unreleased]
- **fix(tui): extract @token text correctly in on_input_submitted
suggestions query (PR #11004 / issue #4741)** — The TUI handler passed
``text.replace("@", "").strip()`` to ``suggestions()``, producing garbage
fuzzy matches (e.g. "analyse \@proj" → "analyse proj"). Replaced with
``re.findall(r"@(\S+)", text)`` that extracts only the last ``@token`` as
the query, returning just the token value without surrounding words.
- **SubplanExecutionService lazy wiring in CLI** (#10268): Wired `subplan_service`
from the DI container into `_get_plan_executor()` so `PlanExecutor` can spawn child
plans during the Execute phase. When `SubplanService` is available but
+1
View File
@@ -48,3 +48,4 @@ Below are some of the specific details of various contributions.
* HAL 9000 has contributed the DecisionService wiring for PlanExecutor strategize persistence fix (#10813): added decision_service to the PlanExecutor constructor and wired it from the CLI dependency-injection container in `_get_plan_executor()`, plus implemented `_persist_strategy_decisions()` to persist strategy decisions as domain `Decision` objects.
* HAL 9000 has contributed the A2A module rename standardization BDD tests (PR #10583 / issue #8615): comprehensive Behave test suite validating that all 22 A2A symbols are properly exported from `cleveragents.a2a`, no legacy ACP references remain in the module source, and documentation uses correct A2A naming conventions — fixing inline imports, unused behave symbols, cross-scenario context dependencies, and missing type annotations.
* HAL 9000 has contributed the `ActorSelectionOverlay._render``_refresh_display` rename fix (PR #11176 / issue #11039, Epic #8174): renamed `_render()` method to `_refresh_display()` to avoid shadowing Textual's `Widget._render()`, fixing a crash in textual >=1.0 where `get_content_height()` would receive `None` and raise `AttributeError: 'NoneType' object has no attribute 'get_height'`.
* HAL 9000 has contributed the TUI @token text extraction fix for suggestions query (PR #11004 / issue #4741): replaced ``text.replace("@", "").strip()`` with ``re.findall(r"@(\S+)", text)[-1]`` in ``on_input_submitted`` to correctly extract only the last @token as the query, preventing garbage fuzzy matches. Includes TDD BDD regression test suite covering single-token, category-prefixed, multi-token, and standalone-token scenarios (PR #11004).
@@ -0,0 +1,252 @@
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"""Step definitions for TDD issue #4741: @token text extraction for suggestions().
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Verifies that ``on_input_submitted`` in ``src/cleveragents/tui/app.py`` extracts
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
only the last ``@token`` from input using regex (``re.findall(r"@(\\S+)", text)``),
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
instead of the buggy ``text.replace("@", "").strip()``.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Uses a Scenario Outline so each <input> / <expected_query> pair is tested identically.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"""
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from __future__ import annotations
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Suggestion: MagicMock and patch imported from unittest.mock but never used in the file. Remove unused imports.

**Suggestion:** `MagicMock` and `patch` imported from unittest.mock but never used in the file. Remove unused imports.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
import contextlib
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
import importlib
Outdated
Review

BLOCKING: Unused import re on line 13 (F401 ruff error). Remove it.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**BLOCKING:** Unused import re on line 13 (F401 ruff error). Remove it. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
import shutil
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
import sys
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
import tempfile
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from pathlib import Path
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from types import ModuleType, SimpleNamespace
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from typing import Any
Outdated
Review

SUGGESTION: Unused patch import from unittest.mock on line 19. Remove it.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**SUGGESTION:** Unused patch import from unittest.mock on line 19. Remove it. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Outdated
Review

BLOCKING (unused import): patch from unittest.mock is imported but never used (ruff F401). Remove it: from unittest.mock import MagicMock.

BLOCKING (unused import): `patch` from `unittest.mock` is imported but never used (ruff F401). Remove it: `from unittest.mock import MagicMock`.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

SUGGESTION - Unused imports: Prior lint reviews flagged unused imports (e.g., re imported but not used in the test file, and possibly patch). Run nox -s lint within the test file scope to identify and remove any dead imports. This wasn't clearly visible from the diff alone.

SUGGESTION - Unused imports: Prior lint reviews flagged unused imports (e.g., `re` imported but not used in the test file, and possibly `patch`). Run `nox -s lint` within the test file scope to identify and remove any dead imports. This wasn't clearly visible from the diff alone.
from unittest.mock import MagicMock
Outdated
Review

Unused imports: re (line ~15) and patch (line ~20) are imported but never called. This is what the CI lint job flags. Please remove them.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

Unused imports: re (line ~15) and patch (line ~20) are imported but never called. This is what the CI lint job flags. Please remove them. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from behave import given, then
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Mock Textual
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
_MOCK_TEXTUAL_KEYS = [
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual",
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.app",
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.containers",
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.widgets",
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
]
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def _build_mock_textual() -> dict[str, ModuleType]:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_textual = ModuleType("textual")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_app_mod = ModuleType("textual.app")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_containers = ModuleType("textual.containers")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_widgets = ModuleType("textual.widgets")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockApp:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __init__(self, *a, **kw):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
pass
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockVertical:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __enter__(self):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return self
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __exit__(self, *a, **kw):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
pass
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockHeader:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __init__(self, *args, **kwargs):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
pass
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockFooter:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __init__(self, *args, **kwargs):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
pass
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockStatic:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __init__(self, *a, **kw):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
self._text = ""
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def update(self, text):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
self._text = str(text)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockInput:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
value: str = ""
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def __init__(self, *a, **kw):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
pass
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def consume_text(self):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return SimpleNamespace(text=self.value)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_app_mod.App = MockApp
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_containers.Vertical = MockVertical
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_widgets.Header = MockHeader
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_widgets.Footer = MockFooter
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_widgets.Static = MockStatic
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_widgets.Input = MockInput
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return {
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual": mock_textual,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.app": mock_app_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.containers": mock_containers,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"textual.widgets": mock_widgets,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
}
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def _restore_modules(context):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
for key, val in getattr(context, "_tui_saved_modules", {}).items():
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
if val is None:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
sys.modules.pop(key, None)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
else:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
sys.modules[key] = val
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.import_module("cleveragents.tui.widgets.help_panel_overlay")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(importlib.import_module("cleveragents.tui.widgets.persona_bar"))
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(importlib.import_module("cleveragents.tui.widgets.prompt"))
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.import_module("cleveragents.tui.widgets.reference_picker")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.import_module("cleveragents.tui.widgets.slash_command_overlay")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(importlib.import_module("cleveragents.tui.app"))
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Given: set up mock + run on_input_submitted with the captured input text
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
@given('the TUI on_input_submitted handler processes "{input_text}"')
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def step_run_on_input_submitted(context, input_text):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"""Install mock Textual, create app, simulate submission, capture query.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
We patch both ``ReferencePickerOverlay.set_suggestions`` and the module-level
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
``suggestions()`` so we can inspect the exact argument passed to it.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
"""
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Remove saved modules from any previous scenario (Scenario Outline)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
_restore_modules(context) if getattr(context, "_tui_saved_modules", None) else None
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mocks = _build_mock_textual()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_saved_modules = {}
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
for key in _MOCK_TEXTUAL_KEYS:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_saved_modules[key] = sys.modules.pop(key, None)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
for key, mod in mocks.items():
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
sys.modules[key] = mod
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Reload widget modules with mocked base classes
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from cleveragents.tui.widgets import (
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
help_panel_overlay as hp_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
persona_bar as pb_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
prompt as prompt_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
reference_picker as rp_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
slash_command_overlay as sco_mod,
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(hp_mod)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(pb_mod)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(prompt_mod)
Outdated
Review

SUGGESTION: Tempdir leak. tempfile.mkdtemp() creates a directory that is never cleaned up. Add shutil.rmtree() cleanup.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**SUGGESTION:** Tempdir leak. tempfile.mkdtemp() creates a directory that is never cleaned up. Add shutil.rmtree() cleanup. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Outdated
Review

BLOCKING (tempdir leak): tempfile.mkdtemp() at line 148 creates a temporary directory that is never removed. This will leak tempdirs across test scenarios. Add cleanup via shutil.rmtree(context._tui_tmpdir) in the context.add_cleanup chain.

BLOCKING (tempdir leak): `tempfile.mkdtemp()` at line 148 creates a temporary directory that is never removed. This will leak tempdirs across test scenarios. Add cleanup via `shutil.rmtree(context._tui_tmpdir)` in the context.add_cleanup chain.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

BLOCKING: tempfile.mkdtemp() creates a temp directory stored in context._tui_tmpdir but never cleaned up. Add shutil.rmtree(context._tui_tmpdir, ignore_errors=True) in the cleanup function registered via add_cleanup.

**BLOCKING: tempfile.mkdtemp() creates a temp directory stored in context._tui_tmpdir but never cleaned up.** Add `shutil.rmtree(context._tui_tmpdir, ignore_errors=True)` in the cleanup function registered via add_cleanup.
Review

SUGGESTION - Tempdir cleanup: Previous reviews noted a tempfile.mkdtemp() call around line ~148 that isn't paired with shutil.rmtree(). Please ensure any temporary directories created during test setup are explicitly cleaned up in the teardown/cleanup phase to prevent filesystem leaks. This wasn't addressable from the review-only read.

SUGGESTION - Tempdir cleanup: Previous reviews noted a `tempfile.mkdtemp()` call around line ~148 that isn't paired with `shutil.rmtree()`. Please ensure any temporary directories created during test setup are explicitly cleaned up in the teardown/cleanup phase to prevent filesystem leaks. This wasn't addressable from the review-only read.
importlib.reload(rp_mod)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(sco_mod)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Install mock persona state and command router before app module reloads
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
tmp_dir = tempfile.mkdtemp()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_tmpdir = Path(tmp_dir)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

BLOCKING: Tuple-returning lambda as Behave cleanup. context.add_cleanup(lambda: (importlib.reload(__import__(...)),)) returns a tuple -- fragile and unclear. Refactor to a named function.

**BLOCKING: Tuple-returning lambda as Behave cleanup.** `context.add_cleanup(lambda: (importlib.reload(__import__(...)),))` returns a tuple -- fragile and unclear. Refactor to a named function.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from cleveragents.tui.persona.registry import PersonaRegistry
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
from cleveragents.tui.persona.state import PersonaState
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
registry = PersonaRegistry(config_dir=Path(tmp_dir))
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
registry.ensure_default()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
persona_state = PersonaState(registry=registry)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
class MockCommandRouter:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def handle(self, raw, *, session_id):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return f"handled:{raw}"
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_router = MockCommandRouter()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_persona_state = persona_state
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_cmd_router = mock_router
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_mod = importlib.import_module("cleveragents.tui.app")
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
importlib.reload(app_mod)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Patch the suggestions function BEFORE instantiating the app, so that when
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# on_input_submitted calls it internally, our spy intercepts it.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
captured_queries: list[str] = []
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def _spy_suggestions(query, *, category=None, limit=8):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
captured_queries.append(query)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return list(
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_mod.suggestions.__wrapped__.__code__.co_varnames[:limit]
Outdated
Review

Tempdir leak (line ~182): tempfile.mkdtemp() creates a directory stored in context._tui_tmpdir but never cleaned up. Add cleanup to context.add_cleanup chain.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

Tempdir leak (line ~182): tempfile.mkdtemp() creates a directory stored in context._tui_tmpdir but never cleaned up. Add cleanup to context.add_cleanup chain. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
) # dummy
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# The suggestions function is imported at module level in app.py. We need to
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# patch it there, not on reference_parser itself.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def spy(query, **kw):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
captured_queries.append(query)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
return []
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_mod.suggestions = spy
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
cls = app_mod._ResolvedTuiApp
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Build mock widgets dict so query_one works
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_inst = cls(command_router=mock_router, persona_state=persona_state)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Manually populate _widgets from the MockApp instance if it exists
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
if hasattr(app_inst, "_widgets"):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict: dict[str, Any] = app_inst._widgets
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
else:
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict = {}
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Create mock widgets that behave correctly
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_prompt = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_prompt.consume_text.return_value = SimpleNamespace(text=input_text)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_picker = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_picker.set_suggestions = lambda q, s: None # dummy, we spy suggestions instead
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict["#reference-picker"] = mock_picker
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_prompt_widget = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
mock_prompt_widget.consume_text.return_value = SimpleNamespace(text=input_text)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict["#prompt"] = mock_prompt_widget
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict["#conversation"] = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict["#help-panel"] = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
wdict["#persona-bar"] = MagicMock()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Patch query_one to use our widget dict
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_inst.query_one = lambda sel, *args, **kw: wdict.get(sel, MagicMock())
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
with contextlib.suppress(Exception):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_inst.on_input_submitted(event=MagicMock())
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Outdated
Review

Broken cleanup lambda (line ~225): The lambda creates a tuple but never executes the reload call - this is a no-op. Fix: change to direct call or remove entirely since _restore_modules() handles restoration.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

Broken cleanup lambda (line ~225): The lambda creates a tuple but never executes the reload call - this is a no-op. Fix: change to direct call or remove entirely since _restore_modules() handles restoration. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context._tui_captured_query = captured_queries[0] if captured_queries else None
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def _cleanup():
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
if hasattr(app_inst, "_widgets"):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
app_inst._widgets.clear()
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def _cleanup_tmpdir(d=context._tui_tmpdir):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
if d is not None and d.exists():
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
shutil.rmtree(str(d), ignore_errors=True)
Outdated
Review

BLOCKING: Broken lambda cleanup. This creates a no-op tuple instead of calling reload(). Fix the parentheses to properly invoke the function.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**BLOCKING:** Broken lambda cleanup. This creates a no-op tuple instead of calling reload(). Fix the parentheses to properly invoke the function. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
Outdated
Review

BLOCKING (no-op lambda): This lambda constructs a tuple without calling anything. (importlib.reload(...),) is a no-op — it just creates a single-element tuple and discards it. Must be: lambda: importlib.reload(__import__("cleveragents.tui.app"))

BLOCKING (no-op lambda): This lambda constructs a tuple without calling anything. `(importlib.reload(...),)` is a no-op — it just creates a single-element tuple and discards it. Must be: `lambda: importlib.reload(__import__("cleveragents.tui.app"))`
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context.add_cleanup(_cleanup)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context.add_cleanup(lambda: _restore_modules(context))
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
context.add_cleanup(_cleanup_tmpdir)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# Then: assertion on the captured query
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
# ---------------------------------------------------------------------------
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
@then('the suggestion query should be "{expected}"')
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
def step_suggestion_query_is_correct(context, expected):
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
assert context._tui_captured_query == expected, (
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
f"Bug #4741: extracted suggestion query was "
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
f"{context._tui_captured_query!r}, expected {expected!r}. "
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
f"The old buggy .replace(@).strip() approach produces garbage matches."
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
)
Review

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing importlib.reload(). The line:

context.add_cleanup(lambda: (importlib.reload(import("cleveragents.tui.app")),))

The trailing comma converts it to a one-element tuple (reload(),) which is never called. Remove the trailing comma, or better yet, remove this line entirely since _restore_modules() already handles module reload as an earlier cleanup step.

Test cleanup lambda has a trailing comma making it a no-op tuple instead of executing ``importlib.reload()``. The line: context.add_cleanup(lambda: (importlib.reload(__import__("cleveragents.tui.app")),)) The trailing comma converts it to a one-element tuple `(reload(),)` which is never called. Remove the trailing comma, or better yet, remove this line entirely since ``_restore_modules()`` already handles module reload as an earlier cleanup step.
@@ -0,0 +1,23 @@
@tdd_issue @tdd_issue_4741
Feature: TDD Issue #4741 — Extract only the @token text as suggestions() query
Bug #4741: ``on_input_submitted`` passed ``text.replace("@", "").strip()`` to
``suggestions()``, e.g. "analyse \@proj" "analyse proj", producing garbage
fuzzy matches because surrounding words polluted the query.
The fix replaces it with ``re.findall(r"@(\S+)", text)`` taking the last
match as the query string, so "analyse \@proj" "proj".
Scenario Outline: @token extraction produces correct queries for input text
The suggestion query must be the last extracted @token from input text.
Outdated
Review

SUGGESTION: Remove @tdd_expected_fail tag now that the fix is implemented and tests pass.


Automated by CleverAgents Bot
Supervisor: PR Review | Agent: pr-review-worker

**SUGGESTION:** Remove @tdd_expected_fail tag now that the fix is implemented and tests pass. --- Automated by CleverAgents Bot Supervisor: PR Review | Agent: pr-review-worker
With the old buggy code these assertions fail; after the fix they pass.
Given the TUI on_input_submitted handler processes "<input>"
Then the suggestion query should be "<expected_query>"
Examples:
| input | expected_query |
| analyse @proj | proj |
| read @project:main-doc | project:main-doc |
| look-up @actor:x @tool:y | tool:y |
| @skill:doc-generator | skill:doc-generator |
+8 -4
View File
@@ -4,6 +4,7 @@ from __future__ import annotations
import importlib
import os
import re
Outdated
Review

BLOCKING: Import order violation. import re (stdlib) must precede non-stdlib or local imports per ruff conventions. Run nox -s lint to see exact violations.

BLOCKING: Import order violation. `import re` (stdlib) must precede non-stdlib or local imports per ruff conventions. Run `nox -s lint` to see exact violations.
Review

BLOCKING - Import ordering (ruff lint F401):
after this file was originally reviewed with lint failures, please verify import re is placed in correct standard-library position (before third-party imports like textual). The previous review flagged this as a hard lint failure. Please run nox -s lint and ensure zero violations before resubmitting.

BLOCKING - Import ordering (ruff lint F401): after this file was originally reviewed with lint failures, please verify `import re` is placed in correct standard-library position (before third-party imports like `textual`). The previous review flagged this as a hard lint failure. Please run `nox -s lint` and ensure zero violations before resubmitting.
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, ClassVar, Protocol
@@ -396,10 +397,13 @@ if _TEXTUAL_AVAILABLE:
expanded = result.expanded_text
if "@" in text:
ref_picker = self.query_one("#reference-picker", ReferencePickerOverlay)
ref_picker.set_suggestions(
text, suggestions(text.replace("@", "").strip())
)
matches = re.findall(r"@(\S+)", text)
if matches:
query_text = matches[-1]
ref_picker = self.query_one(
"#reference-picker", ReferencePickerOverlay
)
ref_picker.set_suggestions(text, suggestions(query_text))
if self._facade is None:
# Facade not wired yet — preview only (graceful degradation)