Skip to content

Make the system's memory reserve a setting the agent can move - #10

Merged
noah-meierlabs merged 2 commits into
mainfrom
feat/memory-reserve
Nov 12, 2026
Merged

noah-meierlabs merged 2 commits into
mainfrom
feat/memory-reserve

Conversation

@noah-meierlabs

Copy link
Copy Markdown
Contributor

Follow-up to #9 (operator 2026-11-12: genco's agent should be able to raise or lower the combined limit).

  • The reserve for the system is a setting (memory in settings): Settings → Memory, genco memory reserve <size|default>, POST /settings/memory (runs apply). Bounds 512 MB to half the RAM; the old formula is the default. A limit a group already has stays allowed above the new cap (as in Cap all groups together and alert on real memory shortage #9).
  • genco memory / GET /settings/memory: RAM, swap, reserve (set or default, bounds), cap, the groups' limits added up, groups now and peak (genco.slice memory.current/peak), system now.
  • genco.slice and new limit checks use the cap from the setting; apply passes it through sync.
  • Agent instructions: when to move it (system short while groups have room, or groups OOM at the cap while the reserve is unused), small steps, numbers in the answer; the daily health check looks at genco memory.
  • Panel: a Memory tab in Settings; the group's limits box shows the cap from there.

Tested on the test server: 1G and 100M refused (max 986 MB on 2 GB), 900M -> genco.slice MemoryMax 1073M, default -> 1205M, sites up.

🤖 Generated with Claude Code

noah-meierlabs and others added 2 commits November 12, 2026 15:48
The cap of all groups together was a fixed formula. The reserve for the
system is now a setting (Settings → Memory, `genco memory reserve
<size|default>`), 512 MB to half the RAM, the formula stays the default;
it applies at once and is refused when a group's own limit would be
above the new cap. `genco memory` shows the split and what the groups
(now and their peak) and the system use. genco's agent may move it in
small steps when the system runs short while the groups have room, or
groups hit the cap while the reserve sits unused, and the daily health
check looks at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- `genco memory` works without a subcommand, as the docs, the agent's
  instructions and the health check use it; `reserve` is long-running
  like apply, so a closed pipe doesn't kill it halfway.
- A reserve that leaves the groups less than they use now without their
  page cache is refused: the kernel would kill in the groups at once.
- "groups now" leaves out their page cache like the system's number, so
  the system's use is no longer undercounted.
- Limit checks take the cap from memory::groups_cap instead of a second
  unchecked subtraction.
- Offline tests for the bounds and the clamping instead of the host's
  RAM.
- Webui: requests in lib/api.ts, applyErrors shared with the quarantine,
  newest() for the reload, the tab reloads after a failed apply, the
  input takes digits only.
- PLAN.md entry, OPERATIONS.md wrapped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noah-meierlabs
noah-meierlabs merged commit 9b39b7d into main Nov 12, 2026
1 check passed
@noah-meierlabs
noah-meierlabs deleted the feat/memory-reserve branch November 12, 2026 14:56
@noah-meierlabs noah-meierlabs mentioned this pull request Nov 12, 2026
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