Repository navigation
fix(bin): keep memory-capped workers alive after process OOM - #5
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Profreshor
added a commit
that referenced
this pull request
Oct 16, 2026
Resolve AGENTS.md by keeping upstream's version, which moved the home layout listing into the operational-home-layout skill, and carry the config/crew-memory-max entry into that skill's listing instead. Resolve bin/fm-spawn.sh by keeping both the upstream and fork header and config-read blocks, and keeping only the systemd-run memory wrap where upstream moved the launch-home-token block earlier.
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.
Intent
When one program inside a crew worker hits the per-worker memory cap from config/crew-memory-max, the whole worker shuts down, not just the program that used too much. At 10:59 on 2026-10-16 the demand worker's test program went over 6G. The kernel killed only that program, but systemd then stopped the rest of the worker's scope, because its default OOMPolicy is stop. The worker quit and had to be relaunched by hand. The fix is to add OOMPolicy=continue to the launch, so only the oversized program is killed and the worker stays alive.
What Changed
OOMPolicy=continueso an OOM kill removes only the offending process and leaves the worker running.Risk Assessment
✅ Low: The bounded shared launch wrapper applies OOMPolicy=continue to every memory-capped worker launch, while the new systemd 243 preflight prevents unsupported-property failures.
Testing
A real isolated Herdr-lab spawn started the worker in a systemd scope. The host did not enforce MemoryMax, so the required OOM-survival behavior remains untested; the unsupported-systemd preflight behavior was only recorded as a non-live test.
Evidence: Live worker probe
Source: Live worker probe
parent-started pid=2479462Evidence: Real systemd worker scope journal
Source: Real systemd worker scope journal
Oct 16 11:37:12 systemd: Started fm-crew-live-oom-…scope - /bin/sh -c "…bash …/.live-oom-harness.sh".Evidence: Host OOM-stimulus check
Source: Host OOM-stimulus check
parent-started child-exit=0 parent-survived systemd-run-exit=0Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-spawn.sh:5092-OOMPolicyfor scope units requires systemd v243+, while the existing preflight accepts anysystemd-run. A host with an older systemd that previously supportedMemoryMaxwill now reachsystemd-runwith an unsupported property and fail to start the worker. Require or probe v243+ in the existing preflight and document that requirement.🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-herdr-lab.sh provision fm-lab-crew-oom-continu-2344885-28321with an isolated named lab, followed by a realfm-spawn.shcapped worker launchrealsystemd-run --user --scope -p MemoryMax=64M -p OOMPolicy=continueOOM-stimulus checktests/fm-spawn-crew-memory-max.test.shgit diff --check c375907662b871fe2643b7100e9f859a8e11a0a9 db2c4e38318371739dbc42ceaff75a810ea2f1cbgit diff … | jev find "a change unrelated to OOM behavior for a crew worker memory cap"(no unrelated hunks flagged)bin/fm-herdr-lab.sh teardown fm-lab-crew-oom-continu-2344885-28321and returned the spawned Treehouse worktree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.