fix(macos): prevent gateway launchd race condition on startup#387
Closed
gupsammy wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix(macos): prevent gateway launchd race condition on startup#387gupsammy wants to merge 1 commit intoopenclaw:mainfrom
gupsammy wants to merge 1 commit intoopenclaw:mainfrom
Conversation
6a3c809 to
677c5c2
Compare
Contributor
|
Thanks Samarth! That's some great digging here. Welcome to the Clawtributors! Say hi on Discord! |
Contributor
|
Landed on main via integration branch (rebased on 0e98371). Included commits:
Local gate:
|
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 9, 2026
…law#387) - Add preserveRunningForJobIds option to recomputeNextRuns() to prevent stuck-run cleanup from clearing running markers on jobs that are still claimed and waiting to execute in the same batch - Fix heartbeat status check: 'error' → 'failed' to match actual API - Add comprehensive regression test suite (10 tests) covering: - Schedule change recalculation - Force mode execution - Isolated job wake time scheduling - allowUnsafeExternalContent persistence on payload patches - Far-future schedule timer delay capping - Hot-loop prevention while run in progress - Manual run skip while timer-triggered run active - wakeMode now → queued heartbeat degradation when busy - Per-job start time and duration for batched jobs - Claimed running markers not cleared mid-batch after long jobs
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.
Summary
Fixes #306 - macOS app menubar icon disappears + gateway launchd start timeout.
Root cause: Race condition during startup where:
KeepAlive)GatewayLaunchAgentManager.set(enabled: true, ...)unconditionally callslaunchctl bootout→ kills the just-started gatewaylaunchctl bootstrapto start it againChanges:
GatewayLaunchAgentManager.swift: Skipbootoutif service is already running; addlaunchctl enablecalls to ensure auto-start on loginTest plan
"launchd service already running, skipping bootout"AI-assisted
🤖 This PR was developed with Claude Code assistance. The fix was iteratively debugged and tested on a real macOS system.
🤖 Generated with Claude Code