fix: resist cache-delete eviction of the menu bar agent#20
Merged
Conversation
As an LSUIElement agent with no open window, RunningBoard rates the app's termination resistance at its lowest, so under disk pressure the cache-delete daemon evicts it (exit reason 0xBADDD15C) and the menu bar icon silently vanishes until next login. Disable sudden and automatic termination at launch to raise resistance — a strong hint to the system, not a hard guarantee under severe pressure. No regression test: termination resistance is process-global runtime state with no public getter, so there is nothing observable to assert. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The menu bar app can silently disappear: as an
LSUIElementagent with no open window, RunningBoard rates its termination resistance at the lowest level. Under disk pressure macOS's cache-delete daemon then evicts it to reclaim container caches — observed in the unified log asexit reason namespace: 15 code: 0xBADDD15C(CacheDeleteAppContainerCaches requesting termination assertion). This is a clean system kill, not a crash, so it leaves no crash report. The app is a login item but not a KeepAlive agent, so it does not relaunch — the icon stays gone until the next login.Fix
Disable sudden and automatic termination at launch (
ProcessInfo.disableSuddenTermination/disableAutomaticTermination). This raises the process's termination resistance so the cache-delete daemon won't pick it first. It's a strong hint, not a hard guarantee under severe pressure — the underlying trigger is a near-full disk.Testing
make build,make test(43 tests),pre-commit— all green. No regression test added: termination resistance is process-global runtime state with no public getter, so there's nothing observable to assert.