Skip to content

Fix Windows freezes from terminal history loading and home-directory Git scans - #591

Merged
parsakhaz merged 1 commit into
mainfrom
fix/windows-apphang-startup
Sep 6, 2026
Merged

Fix Windows freezes from terminal history loading and home-directory Git scans#591
parsakhaz merged 1 commit into
mainfrom
fix/windows-apphang-startup

Conversation

@parsakhaz

Copy link
Copy Markdown
Member

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, and usePtyHost: 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

  • Load only logs/browser panels requiring restart cleanup at startup; restore terminal panels on demand through the existing database fallback.
  • Exclude raw and serialized terminal history from workspace summary queries in SQLite, including legacy double-serialized state. Do not cache incomplete summaries or overwrite persisted history.
  • Skip home-directory Git status scans and recursive watching, log a diagnostic, and return unknown status. Normalize Windows casing, separators, and dot segments. Stop defaulting the legacy Git repository configuration to the home directory.
  • Default the isolated PTY host to enabled on Windows for new and existing configs without this setting. Preserve explicit opt-outs and the existing development override.
  • Document behavior and manual Windows verification.

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:

  • 145 tests passed across the panel-loading database regression, config, Git scan safety, Git watcher, Git status, and RunPane IPC suites.
  • Type checking passed across the workspace.
  • Lint passed, with five existing unused-variable warnings in skillCacheManager.ts.
  • git diff --check passed.

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.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit 4999a13.

@parsakhaz
parsakhaz marked this pull request as ready for review September 6, 2026 05:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T05:35:19.514830Z 4999a13 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@parsakhaz
parsakhaz merged commit 16357a6 into main Sep 6, 2026
10 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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.

1 participant