Files
lg-smtv-mcp/src
kiskaadee 61d231523e
Core Architecture & Invariant CI / validate (pull_request) Successful in 16s
fix(capture): exclude in-flight screenshot from session sweep and harden error boundaries
- src/lg_smtv_mcp/tv_core/capture.py:
  - Preserve in-flight remote_path by passing exclude=remote_path to _ensure_sftp and sweep_temp_files so new-session temp sweeps do not delete the pending frame (CR-01).
  - Deterministically close connection handles on start_sftp_client failure or cancellation (CR-03).
  - Enforce timeout budget with asyncio.timeout inside read_and_remove (CR-06).
  - Attach exception-consuming callback to shielded remove_task to prevent unobserved task warnings if cleanup grace expires (CR-07).
  - Collapse duplicate COMMAND_FAILED and fallback error mapping branches in capture_frame (CR-05).
- src/lg_smtv_mcp/tv_core/protocols.py:
  - Add optional exclude: str | None = None parameter to CaptureTransport.sweep_temp_files.
- tests/test_capture.py:
  - Update FakeSftpClient.listdir to return real files from self.files to eliminate test double discrepancy (CR-02).
  - Add tests for in-flight sweep preservation, connection cleanup on SFTP failure, and read timeout enforcement.
  - Hoist shared FakeCaptureTransport, deduplicate inline test doubles, and drop unused tmp_path fixtures (CR-09).
  - Use fast cleanup_grace=0.05 in cancellation test to avoid real-time stalls (CR-08).
2026-11-16 22:31:35 -05:00
..