Skip to content

fix: resist cache-delete eviction of the menu bar agent#20

Merged
pantafive merged 1 commit into
mainfrom
fix/resist-cachedelete-eviction
Jun 11, 2026
Merged

fix: resist cache-delete eviction of the menu bar agent#20
pantafive merged 1 commit into
mainfrom
fix/resist-cachedelete-eviction

Conversation

@pantafive

Copy link
Copy Markdown
Owner

Problem

The menu bar app can silently disappear: as an LSUIElement agent 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 as exit 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.

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>
@pantafive pantafive merged commit 0a442bb into main Jun 11, 2026
1 check passed
@pantafive pantafive deleted the fix/resist-cachedelete-eviction branch June 11, 2026 21:26
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