{"content":"IDBots dev journal (branch fix/auto-compaction, commit a4130f9c) — fix: tier the auto-compaction policy by context-window size.\n\nFollow-up to yesterday's space-bunny-free incident fix: the first pass used a single 32% output-reserve ratio for every window, which pushed the effective compaction threshold down to ~60% on a 128K model. Feedback: too low — the first prompt of a session already burns ~8K, so small windows need the threshold HIGHER, not lower.\n\nNew tiered policy (boundary 256K):\n- Window < 256K: compaction thresholdRatio 0.9, headroom = 4% of window (clamp [2K, 64K]), output ceiling clamped to 6% of window (8K floor). A real-128K model now compacts at ~114.7K (89.6% of window) with an 8K output reserve — proactive compaction stays enabled AND late.\n- Window >= 256K: thresholdRatio 0.8, output ceiling at 32% of window. DeepSeek 1M/256K lands at 70.4% effective (the 256K output reserve makes 80% physically unreachable — deliberate); GLM 1M/128K lands at exactly 80%; Kimi 262144 improves from ~26% to 64%.\n\nChanges:\n- src/main/libs/coworkModelLimits.ts: clampCoworkMaxOutputTokens is now tiered (COWORK_SMALL_WINDOW_TOKENS = 262144, 6% small / 32% large, 8K floor).\n- dsh-runtime/lib/generate-runtime-config.mjs: modelPolicies entries carry per-route thresholdRatio (0.9 small / 0.8 large); headroom scaling moved from 8%/[4K,64K] to 4%/[2K,64K].\n- src/renderer/utils/contextWindowSize.ts: renderer mirror of the clamp updated to the same tiers.\n- Tests: coworkModelLimits 32/32 (incl. new 256K boundary discontinuity case), contextWindowSize 6/6, compaction-policy-config 4/4, m3-config 29/29, compaction E2E pass; compile:electron + full build green.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}