Skip to content

Conversation

@TylerLeonhardt
Copy link
Member

Copilot AI review requested due to automatic review settings January 28, 2026 21:32
@TylerLeonhardt TylerLeonhardt self-assigned this Jan 28, 2026
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 28, 2026
dmitrivMS
dmitrivMS previously approved these changes Jan 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how Claude code sessions handle directory read failures so that missing session directories are treated gracefully while still exposing unexpected filesystem errors. It adds targeted unit tests and refactors directory reading into a shared helper used by both cache validation and disk loading.

Changes:

  • Introduced a _tryReadDirectory helper in ClaudeCodeSessionService to centralize handling of FileNotFound, DirectoryNotFound, and ENOENT directory read errors by returning an empty entry list.
  • Updated cache validation and disk-loading logic to use _tryReadDirectory and treat empty/missing directories as having no sessions, rather than logging errors.
  • Added directory read error handling tests to claudeCodeSessionService.spec.ts to verify graceful handling of known “not found” errors and propagation of unexpected errors during directory reads.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/extension/agents/claude/node/claudeCodeSessionService.ts Refactors directory reading into _tryReadDirectory and updates cache/disk-loading paths to treat missing directories as empty while logging unexpected read failures.
src/extension/agents/claude/node/test/claudeCodeSessionService.spec.ts Adds tests covering ENOENT/FileNotFound/DirectoryNotFound behavior and expecting propagation for unexpected directory read errors (e.g., EACCES).

@TylerLeonhardt TylerLeonhardt added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit 479da3f Jan 28, 2026
19 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/toxic-mandrill branch January 28, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENOENT: no such file or directory, scandir

4 participants