[AUTO-INF-2] Add coverage for TUI, LSP, and MCP subsystems #9702

Open
opened 2026-04-15 03:19:44 +00:00 by HAL9000 · 0 comments
Owner
## Summary\n- The Textual TUI, LSP registry/server, and MCP adapter subsystems landed in v3.6+ but currently have zero Behave or Robot coverage; the slipcover gate only sees the Behave run, so the 97% metric ignores roughly 290 KB of new code.\n- Without instrumentation these areas can regress silently, undermining v3.7.0 readiness for CLI UX, language server integrations, and tool protocol adapters.\n\n## Findings\n- The nox session "coverage_report" wraps slipcover around Behave only (noxfile.py lines 210-308). Repository tree queries show no files under features/ or robot/ containing the strings tui, lsp, or mcp, so these packages never execute when coverage is collected.\n- src/cleveragents/tui currently contains 35 Python modules (~124 KB), src/cleveragents/lsp contains 11 modules (~106 KB), and src/cleveragents/mcp contains 6 modules (~59 KB); none are exercised by existing Behave scenarios such as features/cli_commands_coverage.feature.\n- CLI entrypoints src/cleveragents/cli/commands/tui.py and lsp.py depend on these packages, yet there are no automated flows that run "agents tui ..." or "agents lsp ...".\n- Issue #9667 covers the TUI shell-safety guardrails only, and coverage hardening issues (#9700, #9697) target Robot aggregation and CI thresholds rather than subsystem coverage.\n\n## Recommendations\n1. **TUI headless coverage** — add features/tui_cli_headless.feature scenarios that run "agents tui --headless", switch personas, export/import sessions to temp directories, and exercise slash-command routing via the injected TuiCommandRouter without launching the Textual event loop.\n2. **LSP CLI workflow coverage** — add features/lsp_registry_coverage.feature scenarios to register (stub YAML), list, show, and remove LSP servers plus a smoke test for "agents lsp serve --log-level debug" using a short stdin/stdout exchange so LspServer.run executes inside slipcover.\n3. **MCP adapter coverage** — add features/mcp_adapter_coverage.feature scenarios that instantiate McpAdapter with a test registry/client, cover refresh hook behaviour, sandbox restrictions, and error paths (missing server, permission denial), and assert structured log output.\n4. Ensure the new scenarios run inside the existing sequential coverage session (reuse BEHAVE_PARALLEL_COVERAGE=1) and document any required environment toggles in CONTRIBUTING.md so contributors can reproduce locally.\n\n### Acceptance Criteria\n- [ ] Behave features for TUI, LSP, and MCP execute during the coverage_report session, raising line coverage for those packages.\n- [ ] TUI headless scenarios validate the persona registry, slash command router, and session export/import paths without launching the full UI loop.\n- [ ] LSP scenarios cover add/list/show/remove flows and the serve stub without hanging tests.\n- [ ] MCP scenarios exercise adapter registry, sandbox, and refresh hook error handling.\n- [ ] Contributor docs gain guidance for running and maintaining the new coverage suites.\n\n### Duplicate Check\n- Open issues (GET /issues?state=open&limit=50&page=1) searched for "TUI coverage", "LSP coverage", and "MCP coverage" — no matches beyond #9667 (shell safety only).\n- Reviewed open coverage-related issues (#9700, #9697) to confirm they address Robot aggregation and CI threshold sourcing, not subsystem coverage.\n- Closed issues (GET /issues?state=closed&limit=50&page=1) searched for "TUI" and "LSP" — no coverage-focused items found.\n\n---\n**Automated by CleverAgents Bot**\nSupervisor: Test Infrastructure Pool | Agent: test-infra-worker\n
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#9702
No description provided.