@@ -72,15 +72,9 @@ export interface BuildStreamTextParamsOptions {
7272 * Token threshold at which to show a compaction warning.
7373 * When the conversation exceeds this threshold, a warning message
7474 * is injected asking the model to call the compact_conversation tool.
75- * Default: 80% of maxTokenThreshold (80 ,000 tokens)
75+ * Default: 80,000 tokens
7676 */
7777 warningThreshold ?: number ;
78- /**
79- * Maximum token threshold for the conversation.
80- * Used to calculate the percentage in the warning message.
81- * Default: 100,000 tokens
82- */
83- maxTokenThreshold ?: number ;
8478 /**
8579 * Model name used for token counting.
8680 * Default: derived from the model parameter or "anthropic/claude-sonnet-4"
@@ -383,12 +377,9 @@ export class Scout {
383377
384378 // Determine if compaction is enabled and get config values
385379 const compactionEnabled = compactionConfig !== false ;
386- const maxTokenThreshold =
387- ( compactionConfig !== false && compactionConfig ?. maxTokenThreshold ) ||
388- DEFAULT_TOKEN_THRESHOLD ;
389380 const warningThreshold =
390381 ( compactionConfig !== false && compactionConfig ?. warningThreshold ) ||
391- Math . floor ( maxTokenThreshold * 0.8 ) ;
382+ Math . floor ( DEFAULT_TOKEN_THRESHOLD * 0.8 ) ;
392383 const compactionModelName =
393384 ( compactionConfig !== false && compactionConfig ?. modelName ) ||
394385 ( typeof model === "object" && "modelId" in model
@@ -428,7 +419,7 @@ export class Scout {
428419 // Inject a compaction warning message at the end of the conversation
429420 const warningMessage = createCompactionWarningMessage (
430421 tokenCount ,
431- maxTokenThreshold
422+ warningThreshold
432423 ) ;
433424 compactedMessages = [ ...compactedMessages , warningMessage ] ;
434425 compactionWarningInjected = true ;
0 commit comments