Make compression threshold editable in the UI. (#12317)

This commit is contained in:
Tommaso Sciortino
2025-10-30 16:03:58 -07:00
committed by GitHub
parent 643f2c0958
commit 3332703fca
10 changed files with 41 additions and 109 deletions

View File

@@ -106,8 +106,7 @@ export class ChatCompressionService {
// Don't compress if not forced and we are under the limit.
if (!force) {
const threshold =
config.getChatCompression()?.contextPercentageThreshold ??
DEFAULT_COMPRESSION_TOKEN_THRESHOLD;
config.getCompressionThreshold() ?? DEFAULT_COMPRESSION_TOKEN_THRESHOLD;
if (originalTokenCount < threshold * tokenLimit(model)) {
return {
newHistory: null,