From 928ca8c454085d06fd7fe6df78b2da07546da73f Mon Sep 17 00:00:00 2001 From: Tomi Eckert Date: Wed, 4 Mar 2026 12:11:39 +0100 Subject: [PATCH] feat: add TokenTracker for managing token usage, costs, and context. --- OpenRouter/TokenTracker.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRouter/TokenTracker.cs b/OpenRouter/TokenTracker.cs index 1fd4ff5..d96d3bb 100644 --- a/OpenRouter/TokenTracker.cs +++ b/OpenRouter/TokenTracker.cs @@ -37,15 +37,15 @@ internal sealed class TokenTracker /// /// Returns true if the context is getting too large and should be compacted. - /// Triggers at min(75% of model context, 100K tokens). + /// Triggers at min(75% of model context, 150K tokens). /// public bool ShouldCompact() { if (LastInputTokens <= 0) return false; int threshold = ContextLength > 0 - ? Math.Min((int)(ContextLength * 0.75), 100_000) - : 100_000; + ? Math.Min((int)(ContextLength * 0.75), 150_000) + : 150_000; return LastInputTokens >= threshold; }