Skip to content

V0.13.1

Choose a tag to compare

@JohnRichard4096 JohnRichard4096 released this 08 Aug 08:04
· 6 commits to main since this release
2d6456c

✨ New Features

  • Per‑Step Token Budget
    Introduced agent_step_token_budget in FunctionConfig. When set, the built‑in step loop stops as soon as the accumulated prompt tokens for the current Step reach the configured budget. This gives fine‑grained control over token usage per iteration, preventing runaway costs in long-running agent loops.
    Default: None (unlimited).

  • Between‑Step History Compression
    Added memory_abstract_threshold in LLMConfig. When the real API prompt‑token count exceeds this threshold at a Step boundary, the oldest history is automatically folded into a single summary message. The summary is generated by the LLM, preserving tool‑call/result pairs to keep the context well‑formed. If the summary fails or is empty, the history remains untouched and the token baseline is reset (no retry loop).
    Default: None (never compress).

🔧 Improvements

  • The token budget is now injected into the run state from the configuration, allowing the step loop to query TokenBudget.exhausted directly.
  • The TokenBudget class gained a reset() method to clear accumulated counts while preserving the configured budget, used after compression.
  • The anthropic dependency version constraint has been relaxed to <0.121.0 to accommodate recent releases.

📚 Documentation

  • All architecture diagrams in the guide have been migrated from ASCII art to Mermaid diagrams for better readability.
  • The step‑loop documentation now includes a full explanation of between‑step compression and token budget control.
  • Configuration tables in the Concepts section have been updated to reflect the new settings and their defaults.
  • API references for FunctionConfig and LLMConfig now document both new parameters.

🧪 Testing

  • Extensive new test coverage for token budget exhaustion, budget injection, and all compression scenarios (threshold conditions, empty summaries, tool‑pair preservation, and baseline reset).

⬆️ Dependencies

  • Upgraded mermaid from 11.15.0 to 11.16.1 in the documentation build.

PRs

  • Build(deps-dev): Bump anthropic from 0.118.0 to 0.120.2 by @dependabot[bot] in #143
  • Build(deps-dev): Bump mermaid from 11.15.0 to 11.16.1 in /docs by @dependabot[bot] in #145
  • Build(deps): Bump js-yaml from 3.15.0 to 3.15.1 in /docs by @dependabot[bot] in #146
  • feat: add per-step token budget and between-step history compression by @JohnRichard4096 in #147

Full Changelog: 0.13.0...0.13.1