fix: remove redundant length guard and fix compact type indentation

This commit is contained in:
JackChen 2026-04-16 23:34:28 +08:00
parent d21d4e035a
commit 60163ccf50
2 changed files with 13 additions and 13 deletions

View File

@ -879,7 +879,7 @@ export class AgentRunner {
strategy: Extract<ContextStrategy, { type: 'compact' }>,
): LLMMessage[] {
const estimated = estimateTokens(messages)
if (estimated <= strategy.maxTokens || messages.length < 4) {
if (estimated <= strategy.maxTokens) {
return messages
}