fix: truncate context logic
C++ / fmt (pull_request) Successful in 4s
C++ / build (pull_request) Failing after 2m6s
C++ / clang-tidy (pull_request) Failing after 2m5s
JS/TS / fmt (pull_request) Failing after 3m8s
Python / static (pull_request) Successful in 24s
Python / verify (pull_request) Successful in 1m21s
JS/TS / lint (pull_request) Successful in 5m10s
Rust / fmt (pull_request) Successful in 30s
Rust / build (pull_request) Successful in 56s
Rust / clippy (pull_request) Successful in 46s

This commit is contained in:
2026-09-04 02:20:37 +02:00
parent 34dde4bbfb
commit cd3da1941b
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;