Cap vendored OptMem wake context
This commit is contained in:
parent
af478550a9
commit
dc45bd3b3f
|
|
@ -53,7 +53,8 @@ KNOBS = {
|
||||||
"PART_CHARS": (20000, "output paging: largest part, in bytes"),
|
"PART_CHARS": (20000, "output paging: largest part, in bytes"),
|
||||||
"PART_LINES": (500, "output paging: largest part, in lines"),
|
"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]
|
ENTRY_CHARS = KNOBS["ENTRY_CHARS"][0]
|
||||||
# Every harness truncates a command that prints too much, and each drops a
|
# 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
|
# 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:
|
if not v.isdigit() or int(v) < 1:
|
||||||
die("%s%s must be a positive whole number, not '%s'." % (where, k, v))
|
die("%s%s must be a positive whole number, not '%s'." % (where, k, v))
|
||||||
top = min(TREE_REC - 8, LOG_REC - 40)
|
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:
|
if k == "ENTRY_CHARS" and int(v) > top:
|
||||||
die("%sENTRY_CHARS is at most %d: a memory has to fit the fixed-width "
|
die("%sENTRY_CHARS is at most %d: a memory has to fit the fixed-width "
|
||||||
"records." % (where, top))
|
"records." % (where, top))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue