fix(installer): memory truth — machine RAM vs Docker's budget, advice clamped (bash half of #417) - #445
Open
LukasWodka wants to merge 2 commits into
Open
fix(installer): memory truth — machine RAM vs Docker's budget, advice clamped (bash half of #417)#445LukasWodka wants to merge 2 commits into
LukasWodka wants to merge 2 commits into
Conversation
Contributor
Author
|
bugbot run |
Contributor
Author
… lines; advice clamped (#417, bash half) The single 'Memory:' line preferred docker info MemTotal over host RAM (_pf_total_mem_kb, 'the Mac trap'), so the same Mac reported 16 GB (host) on a cold run and 6 GB (Docker VM) on a warm re-run — and the remediation could recommend raising the VM past what the machine has. - _pf_memory gates on the MACHINE (on native Linux the daemon sees all host RAM, so the hard-fail gate is unchanged) and prints 'Memory: N GB (machine)'; when a runtime is up with a meaningfully smaller budget (macOS Docker Desktop / colima) it prints a second line, 'Docker's memory budget: N GB', with advice clamped to host - 2 GB via the new _pf_mem_targets (floor 4). Hardware statements stay unclamped — they describe the machine, not a setting. - _pf_runtime_mem_status is the ONE copy for the budget line, shared with _pf_recheck_runtime_mem (the copies used to diverge), and a PF_RUNTIME_MEM_WARNED latch stops one run warning twice. - _pf_hw_summary_line now summarizes host RAM, not the VM budget — the same flip-flop in miniature. - The runtime-preferring _pf_total_mem_kb selector is deleted, along with the tests that codified the trap. Bash half of #417 (Windows half: the fix/417-memory-truth-ps branch); labels, clamp math, and latch semantics mirror the PowerShell side. Closes #417 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LukasWodka
force-pushed
the
fix/417-memory-truth-bash
branch
from
July 27, 2026 15:35
35a5930 to
22426ed
Compare
Contributor
Author
|
Rebased onto |
…p hint on Linux (Bugbot #445) 1. _pf_mem_targets floored budget advice at 4 GB while the status line says the client needs PF_MIN_MEM_GB (5) — on 5-6 GB machines the operator was told 'below the 5 GB the client needs' and 'Give Docker 4 GB' in the same breath. The floor is now PF_MIN_MEM_GB. 2. The non-Darwin remediation said 'Docker Desktop -> Settings' — a dead end on headless/engine-only Linux, where a low budget is the machine's RAM or a VM/cgroup limit. Linux now gets that guidance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
1 similar comment
Contributor
Author
|
bugbot run |
LukasWodka
added a commit
that referenced
this pull request
Jul 27, 2026
…gbot #444) Get-PfMemTargets used Max(4, host-2): on <=6 GB hosts it paired 'below the 5 GB the client needs' with 'give Docker 4 GB' (advice that can never clear the warning), and on <=4 GB hosts the floor exceeded the machine. The floor is now PF_MIN_MEM_GB (5, env-overridable) — the exact twin of the bash fix on #445. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 581f804. Configure here.
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
Bash half of #417 (Windows half: #444) — same three bugs, same design:
_pf_total_mem_kbpreferreddocker info MemTotal— the code's own test even called it "the Mac trap" — so a Mac reported 16 GB (host) cold and 6 GB (Docker VM) warm.PF_REC_MEM_GB=16regardless of the machine._pf_recheck_runtime_memwarning disagreed, and both could fire in one run.Change
_pf_memorygates on the machine (native Linux: daemon sees all host RAM → hard-fail gate unchanged; the 64 MiB grace and the Linux MemAvailable check are preserved) and printsMemory: N GB (machine); a secondDocker's memory budget: N GBline appears only when a runtime is up with a meaningfully smaller budget (the VM case) — never as a duplicate on native Linux._pf_mem_targetsclamps budget advice to host − 2 GB (floor 4); macOS hint covers both Docker Desktop and colima. Hardware statements stay unclamped._pf_runtime_mem_statusis the single shared copy (preflight + recheck) with aPF_RUNTIME_MEM_WARNEDlatch._pf_hw_summary_linenow reports host RAM (it had the same flip-flop in miniature)._pf_total_mem_kbselector and its trap-codifying tests are deleted; 6 new tests cover the clamp matrix, the two-line output, the Linux no-duplicate case, the latch, and the summary line.manifest.sha256regenerated.Labels, clamp math, and latch semantics mirror #444 exactly — a ready-made row for the #435 facts spec.
Stacked on #441 (both touch
preflight.sh); merge #441 first. Same local-macOS test-flake note as #442 applies (3 pre-existing, ubuntu CI is the arbiter).Type
Bug fix
Test plan
preflight.batsfully green including 6 new tests; full bats suite green except the 3 documented pre-existing local-macOS failures;bash -n+shellcheck --severity=errorclean; copy catalog unchanged;gen-manifest.sh --checkclean.🤖 Generated with Claude Code
Note
Low Risk
Installer preflight messaging and test-only changes; Linux hard-fail gates and existing grace/MemAvailable behavior are preserved.
Overview
Fixes installer preflight memory reporting and advice (#417): host RAM vs Docker’s cgroup/VM budget are no longer conflated, and remediation no longer tells users to allocate more RAM than the machine has.
_pf_memorygates on machine RAM (Memory: N GB (machine)), with a secondDocker's memory budgetline only when Docker is up and its budget is meaningfully smaller (macOS/colima/WSL). Native Linux no longer duplicates the same number. The old_pf_total_mem_kbselector (runtime-over-host “Mac trap”) is removed._pf_mem_targetsclamps warn/rec Docker budget advice to host − 2 GB, floored atPF_MIN_MEM_GBso hints never say “give Docker 4 GB” when the client needs 5 GB (#445)._pf_runtime_mem_statusis the single shared warning/hint path for preflight and_pf_recheck_runtime_mem, withPF_RUNTIME_MEM_WARNEDpreventing double warnings; Linux hints avoid Docker Desktop (#445)._pf_hw_summary_lineuses host RAM so the collapsed hardware line doesn’t flip to the VM budget. Bats stubs switch to_pf_host_mem_kb; old selector tests are dropped and six memory truth tests are added.manifest.sha256updated forpreflight.sh.Reviewed by Cursor Bugbot for commit 581f804. Bugbot is set up for automated code reviews on this repo. Configure here.