feat(daemons): release managed model daemons under host memory pressure (#5818) - #6243
Merged
Conversation
Owner
Author
|
Required code review was not completed before publication. This PR is intentionally left open and will not be merged until the required review completes. |
…ail-safe - evaluateMemoryPressurePolicy: track sustained-pressure samples against the hysteresis exit threshold (not the base threshold) once wasUnderPressure is true, so memory sitting in the dead-band still counts toward the sustained window instead of starving eviction indefinitely. - reapIdleDaemons idle-timeout pass: skip a daemon that's already stopped instead of re-stopping it, which was overwriting a prior pressure-release reason and could preempt the pressure-aware pass on the same tick. - reapIdleDaemons idle-timeout pass: fail-safe isPinned reads to true (pinned) on error, matching the pressure-aware pass, so a flaky settings read can't stop a keepLoaded daemon.
atomantic
force-pushed
the
claim/issue-5818
branch
from
September 4, 2026 18:12
68c4ce4 to
ef7cd12
Compare
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
reapIdleDaemonsinserver/lib/managedDaemon.js:evaluateMemoryPressurePolicyevaluating free memory threshold (4GB default), dead-band hysteresis (2GB default), sustained duration (30s default), and calm-down window (60s default)."released at HH:MM — host memory pressure").localLlmSettingsSchemaforllama,mtplx, andslotstream.--sleep-idle-secondsfrom being added tollama-serverlaunch arguments when pinned.isPinned()evaluation errors by treating daemons as pinned to avoid accidental evictions.Closes #5818
Test Plan
server/lib/managedDaemon.pressure.test.js: 18 tests covering memory pressure policy, hysteresis, calm-down, LRU ordering, pinned exemption, fail-safe error handling, and reaper integration.server/services/llamaServerManager.test.js: verified--sleep-idle-secondsomitted whenkeepLoadedis configured.client/src/components/settings/RuntimeServersCard.test.jsx: 31 tests covering "Keep loaded" toggle interaction andreleaseReasonrendering.npm test -- lib/index.test.js: catalog and barrel export validation.