fix(recovery): implement early exit in tool output truncation

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2026-01-02 11:14:28 +09:00
parent 6a21a25d75
commit 45a328155b
2 changed files with 81 additions and 0 deletions
@@ -230,6 +230,10 @@ export function truncateUntilTargetTokens(
toolName: truncateResult.toolName ?? result.toolName,
originalSize: removedSize,
})
if (totalRemoved >= charsToReduce) {
break
}
}
}