fix(desktop): retry controller startup after readiness failure#750
fix(desktop): retry controller startup after readiness failure#750
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 860914304f
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4f8015ebf
ℹ️ 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".
What
Add controller post-start validation with a single bounded recovery retry, and gate real macOS launchd tests behind an explicit opt-in flag.
Why
Packaged desktop could fail to start when the controller exited or became unreachable right after launch, leaving the shell waiting on a dead readiness probe. Separately, the real launchd integration tests were capable of mutating live host launchd state unless they were run intentionally.
How
/api/internal/desktop/readywith fallback to/api/auth/get-sessionRUN_REAL_LAUNCHD_TESTS=1before executing real launchd desktop integration testsAffected areas
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpassespnpm generate-typesrun (if API routes/schemas changed)anytypes introduced (useunknownwith narrowing)Notes for reviewers
The main behavior change is in
apps/desktop/main/services/launchd-bootstrap.ts, specifically the new controller post-start validation and one-time retry path. The real launchd tests are still available, but now requireRUN_REAL_LAUNCHD_TESTS=1to avoid accidental host-state mutation during routine runs.