@poncho-ai/harness 0.31.1 → 0.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/compaction.ts CHANGED
@@ -8,9 +8,11 @@ const MIN_COMPACTABLE_MESSAGES = 4;
8
8
 
9
9
  const DEFAULT_COMPACTION_CONFIG: CompactionConfig = {
10
10
  enabled: true,
11
- trigger: 0.80,
12
- keepRecentMessages: 6,
11
+ trigger: 0.75,
12
+ keepRecentMessages: 4,
13
13
  };
14
+ const SUMMARIZATION_MESSAGE_TRUNCATION_CHARS = 1200;
15
+ const SUMMARIZATION_MAX_OUTPUT_TOKENS = 768;
14
16
 
15
17
  const SUMMARIZATION_PROMPT = `Summarize the following conversation into a structured working state that allows continuation without re-asking questions. Include:
16
18
 
@@ -110,7 +112,9 @@ const buildSummarizationMessages = (
110
112
  const conversationLines: string[] = [];
111
113
  for (const msg of messagesToCompact) {
112
114
  const text = getTextContent(msg);
113
- const truncated = text.length > 2000 ? text.slice(0, 2000) + "\n...[truncated]" : text;
115
+ const truncated = text.length > SUMMARIZATION_MESSAGE_TRUNCATION_CHARS
116
+ ? text.slice(0, SUMMARIZATION_MESSAGE_TRUNCATION_CHARS) + "\n...[truncated]"
117
+ : text;
114
118
  conversationLines.push(`[${msg.role}]: ${truncated}`);
115
119
  }
116
120
 
@@ -193,7 +197,7 @@ export const compactMessages = async (
193
197
  const result = await generateText({
194
198
  model,
195
199
  messages: summarizationMessages,
196
- maxOutputTokens: 2048,
200
+ maxOutputTokens: SUMMARIZATION_MAX_OUTPUT_TOKENS,
197
201
  });
198
202
 
199
203
  const summary = result.text.trim();