diff --git a/src/copilot_usage/vscode_parser.py b/src/copilot_usage/vscode_parser.py index 153319a..778a98f 100644 --- a/src/copilot_usage/vscode_parser.py +++ b/src/copilot_usage/vscode_parser.py @@ -131,8 +131,7 @@ class _VSCodeDiscoveryCache: *newest_child_path* / *newest_child_id* store the most recently modified immediate child at population time; re-stat'ing this single sentinel on a hit detects new window directories added inside an - existing session. *child_ids* is recorded at population time and - retained for diagnostics but is not fully rescanned on cache hits. + existing session. **Limitation:** only changes under the cached newest session directory are detected by the sentinel. If a different (older) session directory @@ -144,7 +143,6 @@ class _VSCodeDiscoveryCache: """ root_id: tuple[int, int] # (st_mtime_ns, st_size) of the logs root - child_ids: _ChildIds newest_child_path: Path | None # most-recently-modified session dir newest_child_id: tuple[int, int] | None # its identity at population log_paths: tuple[Path, ...] @@ -298,7 +296,6 @@ def _cached_discover_vscode_logs(base_path: Path | None) -> list[Path]: found = sorted(candidate.glob(_GLOB_PATTERN)) _VSCODE_DISCOVERY_CACHE[candidate] = _VSCodeDiscoveryCache( root_id=root_id, - child_ids=child_ids, newest_child_path=newest_path, newest_child_id=newest_id, log_paths=tuple(found), diff --git a/tests/copilot_usage/test_vscode_parser.py b/tests/copilot_usage/test_vscode_parser.py index b27cfe0..dbdb1fd 100644 --- a/tests/copilot_usage/test_vscode_parser.py +++ b/tests/copilot_usage/test_vscode_parser.py @@ -2716,7 +2716,6 @@ def test_cache_invalidated_on_root_mtime_change(self, tmp_path: Path) -> None: cached = _VSCODE_DISCOVERY_CACHE[tmp_path] _VSCODE_DISCOVERY_CACHE[tmp_path] = _VSCodeDiscoveryCache( root_id=(cached.root_id[0] + 1_000_000_000, cached.root_id[1]), - child_ids=cached.child_ids, newest_child_path=cached.newest_child_path, newest_child_id=cached.newest_child_id, log_paths=cached.log_paths, @@ -2753,7 +2752,8 @@ def test_discovery_cache_populated(self, tmp_path: Path) -> None: cached = _VSCODE_DISCOVERY_CACHE[tmp_path] assert len(cached.log_paths) == 1 assert cached.root_id == safe_file_identity(tmp_path) - assert cached.child_ids == _scan_child_ids(tmp_path) + assert cached.newest_child_path is not None + assert cached.newest_child_id is not None def test_new_window_under_existing_session_triggers_rediscovery( self, tmp_path: Path @@ -3267,7 +3267,6 @@ def test_field_reassignment_raises(self) -> None: """Assigning to a field after construction raises FrozenInstanceError.""" cache = _VSCodeDiscoveryCache( root_id=(0, 0), - child_ids=frozenset(), newest_child_path=None, newest_child_id=None, log_paths=(),