fix: truncate context logic

This commit is contained in:
2026-09-30 15:01:28 +02:00
parent a59e4286ad
commit 5fc6fda804
15 changed files with 238 additions and 126 deletions
-2
View File
@@ -13,8 +13,6 @@ void LlmTool::setContextSize(int value) {
int LlmTool::inlineBudgetChars() const {
if (m_contextSize <= 0) return DefaultInlineChars;
// About a quarter of the context window, clamped so tiny contexts
// still get a usable result and huge ones stay sane.
const int tokens =
qBound(512, m_contextSize / 4, DefaultInlineChars / CharsPerToken);
return tokens * CharsPerToken;