Skip to content

fix(server): wait for launchd shutdown safely - #56

Merged
lastobelus merged 1 commit into
lastcode/mainfrom
port/upstream/launchd-lifecycle
Aug 22, 2026
Merged

fix(server): wait for launchd shutdown safely#56
lastobelus merged 1 commit into
lastcode/mainfrom
port/upstream/launchd-lifecycle

Conversation

@lastobelus

@lastobelus lastobelus commented Aug 22, 2026

Copy link
Copy Markdown
Owner

LastCode inherits the same macOS background-service lifecycle race as upstream: launchctl bootout can return before the old job finishes draining, while the prior unsupported --wait form and optional-error handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of upstream PR #7874, from upstream commit 7c5adc45ea3ee7456e04339430c2433e3486ffd7. It uses supported launchctl bootout, polls the exact service with launchctl print until launchd confirms absence, and fails closed on timeout, permission, domain, or unexpected-output errors before enabling and bootstrapping.

Provenance:

  • upstream commit: 7c5adc45ea3ee7456e04339430c2433e3486ffd7
  • stable patch ID: e5e07203e79b88a6051cc6eea2159118e4486604
  • LastCode port commit: f52d715a97460fca99afaebc522788a85a8ae1c0

Progresses #39.

Validation:

  • 21 focused boot-service tests
  • server typecheck
  • targeted lint, formatting, and diff checks
  • guarded pnpm lastcode:ci:quick pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@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: 23904533ca

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

Comment thread apps/server/src/cloud/bootService.ts Outdated
@lastobelus
lastobelus force-pushed the port/upstream/launchd-lifecycle branch from 2390453 to f52d715 Compare August 22, 2026 05:40
@lastobelus

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: f52d715a97

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

@lastobelus
lastobelus merged commit d3898e2 into lastcode/main Aug 22, 2026
@lastobelus
lastobelus deleted the port/upstream/launchd-lifecycle branch August 22, 2026 05:56
lastobelus added a commit that referenced this pull request Aug 22, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 22, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 22, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 22, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 23, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 23, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
lastobelus added a commit that referenced this pull request Aug 24, 2026
LastCode inherits the same macOS background-service lifecycle race as
upstream: `launchctl bootout` can return before the old job finishes
draining, while the prior unsupported `--wait` form and optional-error
handling can let reinstall proceed without proving the job is gone.

This is the patch-identical LastCode port of [upstream PR
pingdotgg#7874](pingdotgg#7874), from upstream
commit
[`7c5adc45ea3ee7456e04339430c2433e3486ffd7`](7c5adc4).
It uses supported `launchctl bootout`, polls the exact service with
`launchctl print` until launchd confirms absence, and fails closed on
timeout, permission, domain, or unexpected-output errors before enabling
and bootstrapping.

Provenance:

- upstream commit: `7c5adc45ea3ee7456e04339430c2433e3486ffd7`
- stable patch ID: `e5e07203e79b88a6051cc6eea2159118e4486604`
- LastCode port commit: `f52d715a97460fca99afaebc522788a85a8ae1c0`

Progresses #39.

Validation:

- 21 focused boot-service tests
- server typecheck
- targeted lint, formatting, and diff checks
- guarded `pnpm lastcode:ci:quick` pre-push gate

Implemented by OpenAI Codex (GPT-5.6) in the T3 Code Codex harness.
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