Fix Windows freezes from terminal history loading and home-directory Git scans - #591
Conversation
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4999a13e7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Stop existing watcher if any | ||
| this.stopWatching(sessionId); | ||
|
|
||
| if (isHomeDirectory(worktreePath)) { |
There was a problem hiding this comment.
Check the WSL home before starting Git watchers
On Windows with a WSL-backed project, stored worktree paths are POSIX paths such as /home/alice, while isHomeDirectory() defaults to the host's os.homedir() and win32 path handling, so this check compares that path against something like C:\Users\Alice and always returns false. If the WSL user's home is accidentally a repository, execution therefore continues into startWSLNativeWatcher() and its recursive inotifywait or five-second git status fallback; the corresponding status guard fails for the same reason, preserving the freeze this change is intended to prevent. Resolve the distro's home directory when commandRunner.wslContext is present and compare using POSIX semantics.
AGENTS.md reference: AGENTS.md:L47-L47
Useful? React with 👍 / 👎.
Problem
The September 3, 2026 report described the latest version as “lagging” and “freezing all the time,” with Windows recording
AppHangTransient. The supplied investigation found a 250 MB database with 497 panels and roughly 200 MB of terminal history across 92 stopped sessions, an accidental Git repository at the user-profile root, andusePtyHost: false.Startup eagerly deserialized every panel into the main-process cache, and workspace polling repeatedly loaded terminal buffers just to produce summaries. Focus-triggered Git scans and watching could also traverse the home directory.
Changes
History remains available when reopening old terminals. The existing archived-session retention policy is unchanged; no destructive cleanup or blocking startup VACUUM is introduced.
Validation
Using Node 22.18.0:
skillCacheManager.ts.git diff --checkpassed.The database regression uses more than 24 MB of raw/serialized history across stopped and archived sessions, checks that startup excludes terminal panels, and verifies summary reads preserve history for later restoration.
Remaining verification
Draft pending a packaged Windows smoke test: launch with a large copied database, reopen old terminal history, repeatedly blur/focus a home-directory repository and a normal project, and verify the isolated PTY host starts with the Windows default. This Linux environment cannot reproduce Windows AppHangTransient or validate the packaged Windows host.