Repository navigation
fix(live): start the session host as a launchd job on macOS 27 and later - #987
Merged
Merged
Conversation
Live sessions closed when macOS force-quit a GUI program started from a pane. After agterm quit and the same build relaunched, a program switched off in Allow in the Background became the app of the coalition the session host and its daemons were still in, and loginwindow's force-quit about 30 seconds later took the daemons with it. On macOS 27 and later the client starts agterm-session-host as a one-shot job in the user's GUI launchd domain, which gives the host and its daemons a coalition of their own; responsibility disclaim alone does not change it. Such a host ends with the GUI login session, as a reboot already ends every Live session. A definite bootstrap failure falls back to the disclaimed spawn, and a timed-out one never starts a second host. Older macOS keeps the spawn unchanged. Fixed #985
A session host started as a launchd job removed its job only after an accepted stop. One that found the endpoint already served by another host, or whose startup or serve loop threw, left its one-shot job loaded in the GUI domain until logout. It now tries to boot out its own label after serving ends, including on error, and logs a failed bootout. A host whose key or label is not its own still exits without touching any job. Troubleshooting no longer suggests a reset helps sessions under a host that fell back to the spawned start.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Live sessions closed when macOS force-quit a GUI program started from a pane. After agterm quit and relaunched, a program switched off in Allow in the Background became the app of the coalition the session host and its daemons were still in, and loginwindow's force-quit about 30 seconds later took every session in that coalition with it.
On macOS 27 and later the client starts
agterm-session-hostas a one-shot job in the user's GUI launchd domain, so the host and its daemons get a coalition of their own. Each attempt uses a unique label, its plist is written 0600 into the private endpoint directory and removed once bootstrap returns, and the host refuses a key or label that is not its own. A definite bootstrap failure falls back to the disclaimed spawn; a timed-out one never starts a second host. The host boots out its own job when serving ends, including on error. Older macOS keeps the spawn unchanged.On macOS 27 a job host ends with the GUI login session, as a reboot already ends every Live session. Sessions created before the update keep their old host until Reset Live Sessions moves them, and sessions under a host that fell back to the spawn stay exposed; troubleshooting covers both.
Checked on macOS 27 with a build of this branch: a disallowed Chrome for Testing started from a pane was force-quit, and the host, both daemons and both shells survived it. Microphone capture and Claude Code voice input worked in a Developer ID build. Local Network at the installed path gets checked before the release.
Fixed #985