Skip to content

fix(settings): restore AI detection after effect replay - #3295

Open
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-ai-settings-detection
Open

fix(settings): restore AI detection after effect replay#3295
binaricat wants to merge 1 commit into
mainfrom
codex/smoke-ai-settings-detection

Conversation

@binaricat

Copy link
Copy Markdown
Owner

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

  • Bug fix

Related Issue (optional)

N/A — found during development-app smoke testing.

Changes Made

  • Restore mounted state on effect setup and retain cleanup request invalidation.
  • Add tests running the production lifecycle and asynchronous resolver under React StrictMode, with controlled CLI responses. Cover accepted completion, actual unmount, and superseded requests.

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

  • Tested locally in npm run dev
  • Focused tests: 63 passed, 0 failed (lifecycle, managed-agent state, path types, discovery and authentication probes)
  • Regression tests run against the original implementation: 2 fail; repaired implementation: all 3 pass
  • ESLint passes on changed files
  • Full npm test was not rerun for this change

Checklist

  • Follows existing project style
  • No breaking changes or storage changes
  • No capability schema changes

@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-06T09:42:11.604360Z 4d99076 Manual request
ℹ️ 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.

@binaricat binaricat added the automation:codex-loop Own/bot PR waiting on Codex review↔fix loop label Sep 6, 2026
@binaricat
binaricat marked this pull request as draft September 6, 2026 09:40
@binaricat

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 4d990767b7

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review September 6, 2026 09:42
@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Sep 6, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator

Codex reported no major issues. This PR is marked ready for human review/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants