Fix CLI stop for KeepAlive Kanata service - #1251
Conversation
|
Reviewed the diff. The disable-before-SIGTERM / enable-before-kickstart ordering looks correct and matches the KeepAlive-respawn race described in the bug doc. One coverage gap worth closing before merge:
Minor/non-blocking: the lint tests locate function bodies via a textual Everything else (version bumps, |
|
Reviewed the diff. One correctness concern in 1. Silently swallowed rollback failure in When the SIGTERM guard result.status == 0 else {
_ = Self.run("/bin/launchctl", ["enable", Self.kanataServiceTarget], timeout: 15)
throw HelperError.operationFailed(...)
}The re-enable result is discarded ( 2. Lint test checks source text, not behavior (Tests/KeyPathTests/Lint/HelperServiceKeepAliveLifecycleLintTests.swift) The new test extracts function bodies via string search and asserts that literal argument-array strings (e.g. Everything else (version bumps, qa-script |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12ae70fbb0
ℹ️ 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".
| // is waiting for the stopped postcondition. | ||
| let disableResult = Self.run( | ||
| "/bin/launchctl", | ||
| ["disable", Self.kanataServiceTarget], |
There was a problem hiding this comment.
Clear the persistent disable in every start path
launchctl disable records a persistent override for this label, but only the helper's CLI start/restart methods issue the corresponding enable. After keypath service stop, ordinary app paths—including Settings, wizard, and auto-start—use ServiceLifecycleCoordinator.startKanata() (ServiceLifecycleCoordinator.swift:193-231), whose SMAppService register/kickstart flow never enables the label, so those paths cannot restart Kanata until the user runs a CLI start/restart. Route this transition through the canonical lifecycle coordinator or ensure every start path clears the override.
AGENTS.md reference: AGENTS.md:L331-L332
Useful? React with 👍 / 👎.
Summary
keypath service stopreaches its stopped postconditionValidation
claude-reviewRelease context
Local acceptance of the notarized 1.0.1 build 9 found that the helper successfully signaled Kanata, but launchd immediately respawned the KeepAlive job. This PR is the build-10 release gate before publishing 1.0.1 to the public Sparkle feed.