fix(settings): restore AI detection after effect replay - #3295
Conversation
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex reported no major issues. This PR is marked ready for human review/merge. |
Summary
In
npm run dev, opening Settings > AI > Agents can leave every agent stuck on “Detecting…”. React StrictMode replays effect setup and cleanup; the cleanup marks the page unmounted, but setup never restores that flag. Completed CLI checks are then discarded and their loading indicators never clear.Restore the mounted flag during effect setup while retaining request invalidation on cleanup. This also preserves the existing protection against stale and post-unmount results. Found during release smoke testing; the lifecycle code predates the current release, so this is not attributed to #3178.
Type of Change
Related Issue (optional)
N/A — found during development-app smoke testing.
Changes Made
Screenshots / Demo
Verified in the actual Electron application launched with
npm run dev, using the Settings window. Before: Cursor CLI exists and responds to--version, but all cards remain “Detecting…” indefinitely. After a full settings reload with the repair: Cursor shows “Detected” and “Logged in”, the Check button becomes usable, and another manual check completes.Testing
npm run devnpm testwas not rerun for this changeChecklist