feat: Add contextStrategy to control conversation growth and prevent token explosion in agent runs#88
Conversation
…ustom) to prevent unbounded conversation growth
|
Three issues found, two are blockers: 1. 2. Summary 3. Synthetic marker/summary messages use Repros on request. |
…xt strategy handling
|
Appreciate the review, you caught a subtle edge case with the odd-length rest Fixed a few things:
Thanks again for the sharp eye @JackChen-me |
What
Introduces a
contextStrategyoption to manage conversation history during multi-turn agent runs. Supports sliding-window truncation, LLM-based summarization, and custom compression to prevent unbounded context growth.Why
Currently, agent conversations grow without limit, causing:
This change ensures context size is actively managed during execution, making long-running agent workflows production-ready and cost-efficient.
Closes #59
Checklist
npm run lintpassesnpm testpasses