Commit History
-
Add CI for tests and Ruff (#217)
Unverified signature* Add CI for tests and Ruff Co-authored-by: OpenAI Codex <codex@openai.com> * Enforce Ruff formatting in CI Co-authored-by: OpenAI Codex <codex@openai.com> * Document Ruff pre-commit checks Co-authored-by: OpenAI Codex <codex@openai.com> --------- Co-authored-by: OpenAI Codex <codex@openai.com>754345f -
fix(compaction): break infinite loop + truncate oversized messages (#213)
Guillaume SalouUnverified signature* fix(compaction): break the infinite-compaction loop, truncate oversized messages Sessions stuck in a compaction retry loop have been silently burning Bedrock budget while staying invisible in the session dataset. Pod logs from 2026-05-03 on prod-114 showed the pattern firing minute-after-minute on multiple replicas: Context compacted: 200001 -> 215566 tokens Context compacted: 215566 -> 215572 tokens ContextWindowExceededError — forcing compaction Context compacted: 200001 -> 215544 tokens ... Root cause: a single message in the "untouched" tail (typically a tool output of 80k+ tokens — bash dump, file content, CSV) keeps the post-compact context above the 90% threshold. Compaction triggers again, calls Bedrock again, gets the same 215k result, loops. ~$3 per Opus retry, indefinitely. Sessions never reach _run_session.finally → save_and_upload_detached never fires → cost is real but never lands in total_cost_usd. Cross-check: dataset Bedrock-only coverage on 2026-05-01 …d84b454