mirror of
https://github.com/usestrix/strix.git
synced 2026-08-21 10:48:59 +02:00
Restore cumulative history compaction (removed in the SDK migration) so a long scan no longer replays an ever-growing transcript until it overflows the model's context window and the run fails. - strix/llm/context_budget.py: resolve the model's real input/output token limits from LiteLLM metadata (128k gpt-4o, 272k gpt-5, 1M claude-sonnet-4, 131k deepseek), with a large configurable fallback for unmapped models and a chars/4 token-count fallback. - strix/llm/compaction.py: provider-agnostic compaction via litellm. Keeps a security-focused structured summary (objective, findings, credentials, payloads, URLs/paths, work state, dead ends, next move), keeps the most recent turns by token budget, and snaps the summary boundary so no tool call is separated from its result. Both triggers: proactive before each run and reactive compact-and-retry on a real context-overflow error. - Wire both triggers into the agent run loop next to the existing image recovery; add replace_session_items() with restore-on-failure. Env-tunable via STRIX_CONTEXT_* (auto-compact on by default).