diff --git a/third_party/optmem/memo b/third_party/optmem/memo index 411d013..6c8b838 100755 --- a/third_party/optmem/memo +++ b/third_party/optmem/memo @@ -53,7 +53,8 @@ KNOBS = { "PART_CHARS": (20000, "output paging: largest part, in bytes"), "PART_LINES": (500, "output paging: largest part, in lines"), } -WAKE_LINES = KNOBS["WAKE_LINES"][0] # ~8k tokens of dense text, in 2 parts +WAKE_LINES = 96 +MAX_WAKE_LINES = 96 ENTRY_CHARS = KNOBS["ENTRY_CHARS"][0] # Every harness truncates a command that prints too much, and each drops a # different piece: Claude Code cuts the middle at 30,000 chars, pi cuts the @@ -161,6 +162,9 @@ def size(k, v, where=""): if not v.isdigit() or int(v) < 1: die("%s%s must be a positive whole number, not '%s'." % (where, k, v)) top = min(TREE_REC - 8, LOG_REC - 40) + if k == "WAKE_LINES" and int(v) > MAX_WAKE_LINES: + die("%sWAKE_LINES is at most %d to keep wake within the agent context " + "budget." % (where, MAX_WAKE_LINES)) if k == "ENTRY_CHARS" and int(v) > top: die("%sENTRY_CHARS is at most %d: a memory has to fit the fixed-width " "records." % (where, top))