Skip to content

Agent memory gate: follow-ups from #823 (kill raise lost on calm spell, swap trend, elevated exit) #839

Done

Description

@scuttletoby

Follow-ups from #823 (memory-based agent limit), round-2 lenses A and B (both SAFE). Fix item 1 before cost learning (D5).

  1. (major, not blocking) After one agent OOM kill, the cost raise comes off on the same calm spell that ends the fallback. Kills about 10-11 minutes apart therefore never keep a raise (each kill still drops the limit to the fixed 10). One-line fix: do not take a raise off on the calm spell that ends the fallback. Test: kills every 11 minutes keep the raise.
  2. One slow or failed reading after the gate settled (or a reading complete except one unreadable part) keeps it "elevated" until free memory reaches 150% of the margin, with no 2-minute exit; only the floor of 2 starts meanwhile.
  3. The "swap filling" check compares with the previous reading however close in time, so a burst of start requests can hide slow filling. Compare over a minimum time window.
  4. The 30-second reading timer survives errors but not a crash; a crash ends it. Restart it, or make a crash visible.
  5. Basic-tier hosts (macOS, Linux without systemd) and Codex threads count agents as writers (extra 384 MB), capping writers at about 2-4. Safe; say so in the docs.
  6. Docs/test text: a test comment says the swap threshold is 200 MB (the rule says 64); one more small doc error from lens B.
  7. Kills by memory killers that run as normal programs (for example systemd-oomd) are not counted, so the gate learns nothing from them.

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 22, 2026

    @scuttletoby
    OwnerAuthor

    More follow-ups, from the round-3 code lens on #823 (SAFE): #823 (comment)

    1. Minor: the 64 MB swap "filling" limit is per read (fork-kit/heavy/lib/capacity_rule.py:184, heavy_facts.py:39, :459). The kit reads at most every 5 s (state kept up to 300 s); the server reads every 30 s and on each ask. Slowly filling swap can be "filling" for one and not the other. Add a README line now, or use a per-second rate in a later rule version.
    2. Minor: fork-kit/heavy/tests/facts.test.py has no test that carries the last swap reading across two heavy facts calls; only capacityRule.test.ts checks that reading on the way out. Add it to the shared cases.
    3. Ops: machines with the kit installed keep the old swap rule until heavy-install runs again from the new source. Re-install after Slot gate: enforce the capacity rule by default (dynamic slots D4) #823 merges.

    🤖 Generated with Claude Code

  2. added
    area:machines
    size:small
    type:tech-debt
    on Nov 29, 2026
  3. scuttletoby commented on Nov 29, 2026

    @scuttletoby
    OwnerAuthor

    Done on main: round-2 items 1-4 by 2c6573c (#984); 5-7 are stated in docs/fork/README.md (agent slots section) and the 64 MB test comment is fixed; round-3 items 1-2 by 75df5da (#981) (kit README "Swap trend, per read", facts.test.py test_the_last_swap_reading_carries_to_the_next_call). Round-3 item 3 is a re-install step on each kit machine, not a code change.

    🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:machinessize:smalltype:tech-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions