Compact the worker's context above 200k tokens, from item 231's evaluation of context cost, and file items 235 and 236

This commit is contained in:
2026-10-27 00:13:08 +01:00
parent aa020f15f7
commit f2e239d111
9 changed files with 52 additions and 8 deletions
+3
View File
@@ -12,6 +12,9 @@ from claude_code.session import Session
PRINTED_TOOL_INPUT = 160
# Seconds between reads of the machine's memory while too little of it is available to start a worker.
MEMORY_POLL = 60
# The context size, in tokens, above which the worker's claude compacts, handed to it in this variable: docs/decisions.md → `loop-claude: the worker's claude compacts its context above 200k tokens`.
AUTO_COMPACT_WINDOW = "CLAUDE_CODE_AUTO_COMPACT_WINDOW"
COMPACT_ABOVE = 200_000
def run_worker(root: str, args: list[str], env: dict[str, str], effects: Effects) -> Failure | Limited | None: