Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: drop the "When context fills" setting and always use the server's policy (#11444)

Michael Han9845b2aee60f
diff --git a/studio/frontend/src/features/chat/api/chat-adapter.ts b/studio/frontend/src/features/chat/api/chat-adapter.ts
index bfa169f6622..d69949e55ca 100644
--- a/studio/frontend/src/features/chat/api/chat-adapter.ts
+++ b/studio/frontend/src/features/chat/api/chat-adapter.ts
@@ -6339,8 +6339,6 @@ export function createOpenAIStreamAdapter(
...ggufCompactionRequestFields({
isGguf: isGgufForCompaction,
autoCompactEnabled: runtime.autoCompactEnabled,
- contextPolicy: runtime.contextPolicy,
- compactionHeadroomRatio: runtime.compactionHeadroomRatio,
}),
temperature: params.temperature,
top_p: params.topP,
diff --git a/studio/frontend/src/features/chat/api/chat-settings-api.ts b/studio/frontend/src/features/chat/api/chat-settings-api.ts
index 0facb575ec5..a85a5fb4a53 100644
--- a/studio/frontend/src/features/chat/api/chat-settings-api.ts
+++ b/studio/frontend/src/features/chat/api/chat-settings-api.ts
@@ -75,8 +75,6 @@ export interface PersistedChatSettings {
fitOnDeviceOnly?: boolean;
/** Local GGUF chats: drop oldest turns instead of erroring at the window. */
autoCompactEnabled?: boolean;
- contextPolicy?: "inherit" | "checkpoint" | "rolling";
- compactionHeadroomRatio?: number;
}
interface ChatSettingsResponse {
diff --git a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
index f67ca02f132..84f31e94360 100644
--- a/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-runtime-store.ts
@@ -88,12 +88,7 @@ import {
migrateLegacyQwenDefaults,
type QwenDefaultsMigration,
} from "../utils/qwen-defaults-migration";
-import {
- DEFAULT_AUTO_COMPACT_ENABLED,
- DEFAULT_COMPACTION_HEADROOM_RATIO,
- DEFAULT_CONTEXT_POLICY,
- type LocalContextPolicy,
-} from "../utils/auto-compaction";
+import { DEFAULT_AUTO_COMPACT_ENABLED } from "../utils/auto-compaction";
import { preserveThinkingDefaultFromLoad } from "../lib/resolve-preserve-thinking-default";
import {
THREAD_SCOPED_PARAM_KEYS,
@@ -2393,8 +2388,6 @@ type ChatRuntimeStore = {
autoHealToolCalls: boolean;
nudgeToolCalls: boolean;
autoCompactEnabled: boolean;
- contextPolicy: LocalContextPolicy;
- compactionHeadroomRatio: number;
maxToolCallsPerMessage: number;
toolCallTimeout: number;
kvCacheDtype: string | null;
@@ -2688,8 +2681,6 @@ type ChatRuntimeStore = {
setAutoHealToolCalls: (enabled: boolean) => void;
setNudgeToolCalls: (enabled: boolean) => void;
setAutoCompactEnabled: (enabled: boolean) => void;
- setContextPolicy: (policy: LocalContextPolicy) => void;
- setCompactionHeadroomRatio: (ratio: number) => void;
setMaxToolCallsPerMessage: (value: number) => void;
setToolCallTimeout: (value: number) => void;
setGpuMemoryMode: (mode: "auto" | "manual") => void;
@@ -2735,8 +2726,6 @@ type ScalarSettingKey =
| "autoHealToolCalls"
| "nudgeToolCalls"
| "autoCompactEnabled"
- | "contextPolicy"
- | "compactionHeadroomRatio"
| "maxToolCallsPerMessage"
| "toolCallTimeout"
| "reasoningEnabled"
@@ -2788,8 +2777,6 @@ const SCALAR_SETTING_KEYS = [
"autoHealToolCalls",
"nudgeToolCalls",
"autoCompactEnabled",
- "contextPolicy",
- "compactionHeadroomRatio",
"maxToolCallsPerMessage",
"toolCallTimeout",
"reasoningEnabled",
@@ -4179,8 +4166,6 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
autoHealToolCalls: true,
nudgeToolCalls: true,
autoCompactEnabled: DEFAULT_AUTO_COMPACT_ENABLED,
- contextPolicy: DEFAULT_CONTEXT_POLICY,
- compactionHeadroomRatio: DEFAULT_COMPACTION_HEADROOM_RATIO,
maxToolCallsPerMessage: 25,
toolCallTimeout: 5,
kvCacheDtype: null,
@@ -5822,30 +5807,6 @@ export const useChatRuntimeStore = create<ChatRuntimeStore>((set, get) => ({
queuedSettingsEpoch: state.queuedSettingsEpoch + 1,
};
}),
- setContextPolicy: (contextPolicy) =>
- set((state) => {
- setScalarSettingVersion(
- "contextPolicy",
- contextPolicy,
- state.contextPolicy,
- );
- return {
- contextPolicy,
- queuedSettingsEpoch: state.queuedSettingsEpoch + 1,
- };
- }),
- setCompactionHeadroomRatio: (compactionHeadroomRatio) =>
- set((state) => {
- setScalarSettingVersion(
- "compactionHeadroomRatio",
- compactionHeadroomRatio,
- state.compactionHeadroomRatio,
- );
- return {
- compactionHeadroomRatio,
- queuedSettingsEpoch: state.queuedSettingsEpoch + 1,
- };
- }),
setMaxToolCallsPerMessage: (maxToolCallsPerMessage) =>
set((state) => {
setScalarSettingVersion(
diff --git a/studio/frontend/src/features/chat/utils/auto-compaction.ts b/studio/frontend/src/features/chat/utils/auto-compaction.ts
index a396d1a7085..ffa519c9903 100644
--- a/studio/frontend/src/features/chat/utils/auto-compaction.ts
+++ b/studio/frontend/src/features/chat/utils/auto-compaction.ts
@@ -1,99 +1,20 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-/** Local GGUF auto-compaction preferences. Default follows the server policy. */
+/** Local GGUF auto-compaction. On or off; how it compacts is the server's call.
+ *
+ * Studio used to offer the policy as a setting, but the choice needed the reader to know what a
+ * checkpoint epoch and a rolling window were before it meant anything, and both sides of it were
+ * already the server's to configure. It now always follows the server, which is what the setting
+ * shipped as anyway (UNSLOTH_CONTEXT_POLICY, default "checkpoint"). */
export const DEFAULT_AUTO_COMPACT_ENABLED = true;
-export const DEFAULT_CONTEXT_POLICY = "inherit" as const;
-export const DEFAULT_COMPACTION_HEADROOM_RATIO = 0.25;
-
-export type LocalContextPolicy = "inherit" | "checkpoint" | "rolling";
-
-export const COMPACTION_HEADROOM_CHOICES = [0.25, 0.1, 0.05, 0] as const;
-
-export type CompactionStyleValue =
- | "inherit"
- | "checkpoint"
- | "rolling:0.25"
- | "rolling:0.1"
- | "rolling:0.05"
- | "rolling:0";
-
-export function sanitizeContextPolicy(
- value: unknown,
-): LocalContextPolicy | undefined {
- return value === "inherit" || value === "checkpoint" || value === "rolling"
- ? value
- : undefined;
-}
-
-export function sanitizeCompactionHeadroomRatio(
- value: unknown,
-): number | undefined {
- if (typeof value !== "number" || !Number.isFinite(value)) return undefined;
- const clamped = Math.max(0, Math.min(0.9, Math.round(value * 100) / 100));
- let nearest: (typeof COMPACTION_HEADROOM_CHOICES)[number] =
- COMPACTION_HEADROOM_CHOICES[0];
- let best = Math.abs(clamped - nearest);
- for (const choice of COMPACTION_HEADROOM_CHOICES) {
- const distance = Math.abs(clamped - choice);
- if (distance < best) {
- nearest = choice;
- best = distance;
- }
- }
- return nearest;
-}
-
-export function compactionStyleValue(
- policy: LocalContextPolicy,
- ratio: number,
-): CompactionStyleValue {
- if (policy === "inherit") return "inherit";
- if (policy !== "rolling") return "checkpoint";
- const rounded =
- sanitizeCompactionHeadroomRatio(ratio) ?? DEFAULT_COMPACTION_HEADROOM_RATIO;
- if (rounded === 0) return "rolling:0";
- if (rounded === 0.05) return "rolling:0.05";
- if (rounded === 0.1) return "rolling:0.1";
- return "rolling:0.25";
-}
-
-export function parseCompactionStyle(value: string): {
- contextPolicy: LocalContextPolicy;
- compactionHeadroomRatio: number;
-} {
- switch (value) {
- case "inherit":
- return {
- contextPolicy: "inherit",
- compactionHeadroomRatio: DEFAULT_COMPACTION_HEADROOM_RATIO,
- };
- case "rolling:0":
- return { contextPolicy: "rolling", compactionHeadroomRatio: 0 };
- case "rolling:0.05":
- return { contextPolicy: "rolling", compactionHeadroomRatio: 0.05 };
- case "rolling:0.1":
- return { contextPolicy: "rolling", compactionHeadroomRatio: 0.1 };
- case "rolling:0.25":
- return { contextPolicy: "rolling", compactionHeadroomRatio: 0.25 };
- default:
- return {
- contextPolicy: "checkpoint",
- compactionHeadroomRatio: DEFAULT_COMPACTION_HEADROOM_RATIO,
- };
- }
-}
export function ggufCompactionRequestFields(options: {
isGguf: boolean;
autoCompactEnabled: boolean;
- contextPolicy: LocalContextPolicy;
- compactionHeadroomRatio: number;
}): {
context_overflow?: "error" | "truncate_oldest";
- context_policy?: Exclude<LocalContextPolicy, "inherit">;
- compaction_headroom_ratio?: number;
} {
if (!options.isGguf) return {};
if (!options.autoCompactEnabled) {
@@ -101,20 +22,6 @@ export function ggufCompactionRequestFields(options: {
// explicit refusal of that fallback.
return { context_overflow: "error" };
}
- if (options.contextPolicy === "rolling") {
- return {
- context_overflow: "truncate_oldest",
- context_policy: "rolling",
- compaction_headroom_ratio:
- sanitizeCompactionHeadroomRatio(options.compactionHeadroomRatio) ??
- DEFAULT_COMPACTION_HEADROOM_RATIO,
- };
- }
- if (options.contextPolicy === "inherit") {
- return { context_overflow: "truncate_oldest" };
- }
- return {
- context_overflow: "truncate_oldest",
- context_policy: "checkpoint",
- };
+ // No context_policy: the server applies UNSLOTH_CONTEXT_POLICY.
+ return { context_overflow: "truncate_oldest" };
}
diff --git a/studio/frontend/src/features/chat/utils/chat-settings-storage.ts b/studio/frontend/src/features/chat/utils/chat-settings-storage.ts
index e519305e83d..713717412af 100644
--- a/studio/frontend/src/features/chat/utils/chat-settings-storage.ts
+++ b/studio/frontend/src/features/chat/utils/chat-settings-storage.ts
@@ -23,10 +23,6 @@ import {
} from "../presets/preset-policy";
import type { ReasoningEffort } from "../stores/chat-runtime-store";
import { MAX_SAMPLING_SEED } from "../types/runtime";
-import {
- sanitizeCompactionHeadroomRatio,
- sanitizeContextPolicy,
-} from "./auto-compaction";
import {
assignSanitizedMirroredSettings,
hasNoMirroredSettings,
@@ -303,10 +299,6 @@ export function sanitizeChatSettings(value: unknown): PersistedChatSettings {
const autoHealToolCalls = sanitizeBool(value.autoHealToolCalls);
const nudgeToolCalls = sanitizeBool(value.nudgeToolCalls);
const autoCompactEnabled = sanitizeBool(value.autoCompactEnabled);
- const contextPolicy = sanitizeContextPolicy(value.contextPolicy);
- const compactionHeadroomRatio = sanitizeCompactionHeadroomRatio(
- value.compactionHeadroomRatio,
- );
const maxToolCallsPerMessage = sanitizeInt(value.maxToolCallsPerMessage, 0);
const toolCallTimeout = sanitizeInt(value.toolCallTimeout, 1);
@@ -341,10 +333,6 @@ export function sanitizeChatSettings(value: unknown): PersistedChatSettings {
if (autoCompactEnabled !== undefined) {
settings.autoCompactEnabled = autoCompactEnabled;
}
- if (contextPolicy) settings.contextPolicy = contextPolicy;
- if (compactionHeadroomRatio !== undefined) {
- settings.compactionHeadroomRatio = compactionHeadroomRatio;
- }
if (maxToolCallsPerMessage !== undefined) {
settings.maxToolCallsPerMessage = maxToolCallsPerMessage;
}
@@ -410,8 +398,6 @@ export function isEmptyChatSettings(settings: PersistedChatSettings): boolean {
settings.autoHealToolCalls === undefined &&
settings.nudgeToolCalls === undefined &&
settings.autoCompactEnabled === undefined &&
- settings.contextPolicy === undefined &&
- settings.compactionHeadroomRatio === undefined &&
settings.maxToolCallsPerMessage === undefined &&
settings.toolCallTimeout === undefined &&
hasNoMirroredSettings(settings)
diff --git a/studio/frontend/src/features/chat/utils/queued-chat-run-settings.ts b/studio/frontend/src/features/chat/utils/queued-chat-run-settings.ts
index 67a50573e5d..5df89a03c98 100644
--- a/studio/frontend/src/features/chat/utils/queued-chat-run-settings.ts
+++ b/studio/frontend/src/features/chat/utils/queued-chat-run-settings.ts
@@ -45,8 +45,6 @@ const QUEUED_SETTING_KEYS = [
"maxToolCallsPerMessage",
"toolCallTimeout",
"autoCompactEnabled",
- "contextPolicy",
- "compactionHeadroomRatio",
] as const;
type ChatRuntimeState = ReturnType<typeof useChatRuntimeStore.getState>;
diff --git a/studio/frontend/src/features/settings/settings-search.ts b/studio/frontend/src/features/settings/settings-search.ts
index 674940db963..c29a6911bf1 100644
--- a/studio/frontend/src/features/settings/settings-search.ts
+++ b/studio/frontend/src/features/settings/settings-search.ts
@@ -110,7 +110,6 @@ export const SETTINGS_SEARCH_INDEX: Record<SettingsTab, TranslationKey[]> = {
"settings.chat.projectAttachments",
"settings.chat.rememberParamsPerModel",
"settings.chat.autoCompact",
- "settings.chat.compactionStyle",
"settings.profile.greetingSloth",
"settings.chat.thinking.collapseByDefault",
"settings.chat.tools.collapseByDefault",
@@ -315,5 +314,4 @@ export const SETTINGS_SEARCH_KEYWORDS: Partial<
"settings.resources.modelMemory.noRamReserve":
"settings.resources.modelMemory.modelMemoryKeywords",
"settings.chat.autoCompact": "settings.chat.autoCompactKeywords",
- "settings.chat.compactionStyle": "settings.chat.autoCompactKeywords",
};
diff --git a/studio/frontend/src/features/settings/tabs/chat-tab.tsx b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
index d7e10b3e290..4af09cb05b5 100644
--- a/studio/frontend/src/features/settings/tabs/chat-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
@@ -18,10 +18,6 @@ import {
usePlusMenuPrefsStore,
useSidebarOrganizationStore,
} from "@/features/chat";
-import {
- compactionStyleValue,
- parseCompactionStyle,
-} from "@/features/chat/utils/auto-compaction";
import { PASTED_TEXT_THRESHOLD_CHOICES } from "@/features/chat/utils/pasted-text";
import { refreshContextUsage } from "@/features/chat/utils/refresh-context-usage";
import { formatBindingLabel, isMacPlatform } from "../lib/keyboard-shortcuts";
@@ -167,16 +163,6 @@ export function ChatTab() {
const setAutoCompactEnabled = useChatRuntimeStore(
(state) => state.setAutoCompactEnabled,
);
- const contextPolicy = useChatRuntimeStore((state) => state.contextPolicy);
- const compactionHeadroomRatio = useChatRuntimeStore(
- (state) => state.compactionHeadroomRatio,
- );
- const setContextPolicy = useChatRuntimeStore(
- (state) => state.setContextPolicy,
- );
- const setCompactionHeadroomRatio = useChatRuntimeStore(
- (state) => state.setCompactionHeadroomRatio,
- );
const showGreetingSloth = useUserProfileStore((s) => s.showGreetingSloth);
const setShowGreetingSloth = useUserProfileStore(
(s) => s.setShowGreetingSloth,
@@ -389,53 +375,6 @@ export function ChatTab() {
onCheckedChange={setAutoCompactEnabled}
/>
</SettingsRow>
- <SettingsRow
- label={t("settings.chat.compactionStyle")}
- description={t(
- contextPolicy === "inherit"
- ? "settings.chat.compactionDescriptionInherit"
- : contextPolicy === "checkpoint"
- ? "settings.chat.compactionDescriptionCheckpoint"
- : "settings.chat.compactionDescriptionRolling",
- )}
- >
- <Select
- value={compactionStyleValue(contextPolicy, compactionHeadroomRatio)}
- onValueChange={(value) => {
- const next = parseCompactionStyle(value);
- setContextPolicy(next.contextPolicy);
- setCompactionHeadroomRatio(next.compactionHeadroomRatio);
- }}
- disabled={!autoCompactEnabled}
- >
- <SelectTrigger
- className="w-64"
- aria-label={t("settings.chat.compactionStyle")}
- >
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="inherit">
- {t("settings.chat.compactionStyleInherit")}
- </SelectItem>
- <SelectItem value="checkpoint">
- {t("settings.chat.compactionStyleCheckpoint")}
- </SelectItem>
- <SelectItem value="rolling:0.25">
- {t("settings.chat.compactionStyleRollingDefault")}
- </SelectItem>
- <SelectItem value="rolling:0.1">
- {t("settings.chat.compactionStyleRolling10")}
- </SelectItem>
- <SelectItem value="rolling:0.05">
- {t("settings.chat.compactionStyleRolling5")}
- </SelectItem>
- <SelectItem value="rolling:0">
- {t("settings.chat.compactionStyleRollingNone")}
- </SelectItem>
- </SelectContent>
- </Select>
- </SettingsRow>
</SettingsSection>
<SettingsSection title={t("settings.chat.groups.conversations.title")}>
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 2704ad03376..07d64f7bf66 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -1531,11 +1531,6 @@ export const ar = {
"يصبح النص الملصق الذي يبلغ {count} حرفًا أو أكثر مرفقًا بصيغة .txt. يبقى النص الأقصر في مربع الرسالة.",
pastedTextOffDescription:
"يبقى كل النص الملصق في مربع الرسالة، مهما كان طوله.",
- compactionDescriptionInherit: "يتبع سياسة السياق المحددة على الخادم.",
- compactionDescriptionCheckpoint:
- "يحتفظ بآخر تبادل للرسائل وبما يتّسع من التعليمات الدائمة، ويؤرشف البقية ليتسنى استرجاعها.",
- compactionDescriptionRolling:
- "يؤرشف أقدم التبادلات للاحتفاظ بالسجل الحديث والمساحة الإضافية المحددة.",
projectsSection: "إظهار قسم المشاريع",
projectsSectionDescription:
"يجمع محادثات المشروع تحت عنوان المشاريع. أوقف هذا الخيار لعرضها ضمن الأخيرة بدلاً من ذلك.",
@@ -1583,15 +1578,6 @@ export const ar = {
autoCompact: "ضغط المحادثات الطويلة تلقائيًا",
autoCompactDescription:
"تنتقل الأدوار الأقدم إلى أرشيف قابل للبحث عندما تمتلئ نافذة سياق المحادثة.",
- compactionStyle: "عند امتلاء السياق",
- compactionStyleDescription:
- "يُبقي الخيار الافتراضي للخادم UNSLOTH_CONTEXT_POLICY. تحتفظ إعادة ضبط المحادثة بأحدث دور وبما يتّسع من التعليمات الدائمة. تحذف النافذة المنزلقة الأدوار الأقدم ويمكنها الاحتفاظ بمزيد من السجل الحديث.",
- compactionStyleInherit: "استخدام إعداد الخادم الافتراضي",
- compactionStyleCheckpoint: "إعادة ضبط المحادثة",
- compactionStyleRollingDefault: "أرشفة الأدوار الأقدم (مساحة إضافية نحو 25%)",
- compactionStyleRolling10: "أرشفة الأدوار الأقدم (مساحة إضافية نحو 10%)",
- compactionStyleRolling5: "أرشفة الأدوار الأقدم (مساحة إضافية نحو 5%)",
- compactionStyleRollingNone: "أرشفة الأدوار الأقدم (دون اقتطاع إضافي)",
autoCompactKeywords:
"ضغط تلقائي سياق نافذة اقتطاع منزلقة نقطة تحقق هامش أرشيف استرجاع بحث compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index 0cb231ffac0..a112ccb72af 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -1567,11 +1567,6 @@ export const de = {
"Eingefügter Text ab {count} Zeichen wird als .txt-Datei angehängt. Kürzerer Text bleibt im Nachrichtenfeld.",
pastedTextOffDescription:
"Eingefügter Text bleibt unabhängig von seiner Länge im Nachrichtenfeld.",
- compactionDescriptionInherit: "Folgt der Kontextrichtlinie des Servers.",
- compactionDescriptionCheckpoint:
- "Behält den letzten Austausch und so viele der dauerhaft geltenden Anweisungen bei, wie hineinpassen, und archiviert den Rest zum Nachschlagen.",
- compactionDescriptionRolling:
- "Archiviert die ältesten Gesprächsrunden und behält neuere Inhalte mit dem gewählten zusätzlichen Freiraum.",
projectsSection: "Projektbereich anzeigen",
projectsSectionDescription:
"Gruppiert Projekt-Chats unter einer Überschrift für Projekte. Deaktiviere dies, um sie stattdessen unter den zuletzt verwendeten Chats aufzulisten.",
@@ -1619,19 +1614,6 @@ export const de = {
autoCompact: "Lange Chats automatisch komprimieren",
autoCompactDescription:
"Ältere Runden wandern in ein durchsuchbares Archiv, wenn ein Chat voll läuft.",
- compactionStyle: "Wenn der Kontext voll ist",
- compactionStyleDescription:
- "Die Servervorgabe behält UNSLOTH_CONTEXT_POLICY bei. Gespräch zurücksetzen behält die letzte Runde und so viele dauerhafte Anweisungen, wie hineinpassen. Ein gleitendes Fenster verwirft die ältesten Runden und kann mehr aktuellen Verlauf behalten.",
- compactionStyleInherit: "Servervorgabe verwenden",
- compactionStyleCheckpoint: "Gespräch zurücksetzen",
- compactionStyleRollingDefault:
- "Älteste Runden archivieren (~25 % zusätzlicher Platz)",
- compactionStyleRolling10:
- "Älteste Runden archivieren (~10 % zusätzlicher Platz)",
- compactionStyleRolling5:
- "Älteste Runden archivieren (~5 % zusätzlicher Platz)",
- compactionStyleRollingNone:
- "Älteste Runden archivieren (keine zusätzliche Kürzung)",
autoCompactKeywords:
"Komprimierung automatisch Kontext Fenster kürzen gleitend Prüfpunkt Reserve Archiv Abruf Suche compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index ae44a3905cf..b8988c3e94c 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -1527,11 +1527,6 @@ export const en = {
pastedTextShortDescription:
"Pastes of {count} characters or more become .txt attachments.",
pastedTextOffDescription: "Pasted text always stays in the message box.",
- compactionDescriptionInherit: "Follow the server's context policy.",
- compactionDescriptionCheckpoint:
- "Keep the latest turn and the standing instructions that fit, and archive the rest for retrieval.",
- compactionDescriptionRolling:
- "Archive the oldest turns to keep recent history and the selected amount of extra room.",
projectsSection: "Show projects section",
projectsSectionDescription:
"Group project chats under Projects. When off, show them in Recents.",
@@ -1578,15 +1573,6 @@ export const en = {
autoCompact: "Auto-compact long chats",
autoCompactDescription:
"Older turns move to a searchable archive when a chat fills its context.",
- compactionStyle: "When context fills",
- compactionStyleDescription:
- "Use server default keeps UNSLOTH_CONTEXT_POLICY. Reset conversation keeps the latest turn and the standing instructions that fit. A sliding window drops oldest turns and can keep more recent history.",
- compactionStyleInherit: "Use server default",
- compactionStyleCheckpoint: "Reset conversation",
- compactionStyleRollingDefault: "Archive oldest turns (~25% extra room)",
- compactionStyleRolling10: "Archive oldest turns (~10% extra room)",
- compactionStyleRolling5: "Archive oldest turns (~5% extra room)",
- compactionStyleRollingNone: "Archive oldest turns (no extra trim)",
autoCompactKeywords:
"compaction compact auto-compact context window truncate rolling checkpoint headroom archive retrieval recall rag search",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index a9fe301cc46..29fb5925fb2 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -1558,11 +1558,6 @@ export const es = {
"El texto pegado de {count} caracteres o más se convierte en un adjunto .txt. El texto más corto queda en el cuadro de mensaje.",
pastedTextOffDescription:
"Todo el texto pegado queda en el cuadro de mensaje, sin importar su longitud.",
- compactionDescriptionInherit: "Sigue la política de contexto del servidor.",
- compactionDescriptionCheckpoint:
- "Conserva el último intercambio y las instrucciones permanentes que quepan, y archiva el resto para poder consultarlo.",
- compactionDescriptionRolling:
- "Archiva los turnos más antiguos para conservar el historial reciente y el espacio adicional seleccionado.",
projectsSection: "Mostrar la sección Proyectos",
projectsSectionDescription:
"Agrupa los chats de proyecto bajo un encabezado Proyectos. Desactívalo para listarlos en Recientes.",
@@ -1610,19 +1605,6 @@ export const es = {
autoCompact: "Compactar automáticamente chats largos",
autoCompactDescription:
"Los turnos antiguos pasan a un archivo consultable al llenarse el contexto de un chat.",
- compactionStyle: "Cuando se llena el contexto",
- compactionStyleDescription:
- "Usar el valor del servidor conserva UNSLOTH_CONTEXT_POLICY. Restablecer la conversación mantiene el último turno y las instrucciones permanentes que quepan. Una ventana deslizante descarta los turnos más antiguos y puede conservar más historial reciente.",
- compactionStyleInherit: "Usar valor del servidor",
- compactionStyleCheckpoint: "Restablecer conversación",
- compactionStyleRollingDefault:
- "Archivar turnos antiguos (~25% de espacio extra)",
- compactionStyleRolling10:
- "Archivar turnos antiguos (~10% de espacio extra)",
- compactionStyleRolling5:
- "Archivar turnos antiguos (~5% de espacio extra)",
- compactionStyleRollingNone:
- "Archivar turnos antiguos (sin recorte adicional)",
autoCompactKeywords:
"compactación compactar automáticamente contexto ventana truncar deslizante checkpoint margen archivo recuperación búsqueda compaction rolling headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index 4b061238935..12363ce8a96 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -1564,11 +1564,6 @@ export const fr = {
"Le texte collé de {count} caractères ou plus devient une pièce jointe .txt. Le texte plus court reste dans le champ de message.",
pastedTextOffDescription:
"Tout le texte collé reste dans le champ de message, quelle que soit sa longueur.",
- compactionDescriptionInherit: "Suit la politique de contexte du serveur.",
- compactionDescriptionCheckpoint:
- "Conserve le dernier échange et les instructions permanentes qui tiennent, et archive le reste pour pouvoir le retrouver.",
- compactionDescriptionRolling:
- "Archive les échanges les plus anciens pour conserver les plus récents et la marge choisie.",
projectsSection: "Afficher la section Projets",
projectsSectionDescription:
"Regroupe les discussions de projet sous un titre Projets. Désactivez cette option pour les lister dans Récents.",
@@ -1616,19 +1611,6 @@ export const fr = {
autoCompact: "Compacter automatiquement les longues discussions",
autoCompactDescription:
"Les anciens échanges vont dans une archive consultable quand un chat sature son contexte.",
- compactionStyle: "Lorsque le contexte est plein",
- compactionStyleDescription:
- "La valeur par défaut du serveur conserve UNSLOTH_CONTEXT_POLICY. Réinitialiser la discussion garde le dernier tour et les instructions permanentes qui tiennent. Une fenêtre glissante supprime les tours les plus anciens et peut conserver davantage d’historique récent.",
- compactionStyleInherit: "Utiliser la valeur du serveur",
- compactionStyleCheckpoint: "Réinitialiser la discussion",
- compactionStyleRollingDefault:
- "Archiver les anciens tours (~25 % d’espace supplémentaire)",
- compactionStyleRolling10:
- "Archiver les anciens tours (~10 % d’espace supplémentaire)",
- compactionStyleRolling5:
- "Archiver les anciens tours (~5 % d’espace supplémentaire)",
- compactionStyleRollingNone:
- "Archiver les anciens tours (sans réduction supplémentaire)",
autoCompactKeywords:
"compaction automatique contexte fenêtre tronquer glissante point de contrôle marge archive récupération recherche rolling checkpoint headroom retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index 1e969ed0465..16f29a4a50e 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -1537,12 +1537,6 @@ export const hi = {
"{count} या अधिक अक्षरों वाला पेस्ट किया गया टेक्स्ट .txt अटैचमेंट बन जाता है। छोटा टेक्स्ट संदेश बॉक्स में रहता है।",
pastedTextOffDescription:
"पेस्ट किया गया सारा टेक्स्ट संदेश बॉक्स में रहता है, चाहे उसकी लंबाई कितनी भी हो।",
- compactionDescriptionInherit:
- "सर्वर की संदर्भ नीति का पालन करें।",
- compactionDescriptionCheckpoint:
- "सबसे हाल का संवाद और जितने स्थायी निर्देश समा सकें, उन्हें बनाए रखें, और बाकी को खोज के लिए आर्काइव करें।",
- compactionDescriptionRolling:
- "पुराने संवाद आर्काइव करके हाल का इतिहास और चुनी गई अतिरिक्त खाली जगह बनाए रखें।",
projectsSection: "प्रोजेक्ट अनुभाग दिखाएँ",
projectsSectionDescription:
"प्रोजेक्ट चैट को प्रोजेक्ट शीर्षक के नीचे समूहित करता है। बंद करने पर वे हाल ही के अंतर्गत दिखती हैं।",
@@ -1590,15 +1584,6 @@ export const hi = {
autoCompact: "लंबी चैट को अपने आप कॉम्पैक्ट करें",
autoCompactDescription:
"चैट का कॉन्टेक्स्ट भरने पर पुराने टर्न खोजे जा सकने वाले आर्काइव में चले जाते हैं।",
- compactionStyle: "कॉन्टेक्स्ट भरने पर",
- compactionStyleDescription:
- "सर्वर डिफ़ॉल्ट से UNSLOTH_CONTEXT_POLICY बना रहता है। बातचीत रीसेट करने पर नवीनतम टर्न और जितने स्थायी निर्देश समा सकें, वे रहते हैं। स्लाइडिंग विंडो सबसे पुराने टर्न हटाती है और हाल का अधिक इतिहास रख सकती है।",
- compactionStyleInherit: "सर्वर डिफ़ॉल्ट उपयोग करें",
- compactionStyleCheckpoint: "बातचीत रीसेट करें",
- compactionStyleRollingDefault: "पुराने टर्न आर्काइव करें (~25% अतिरिक्त जगह)",
- compactionStyleRolling10: "पुराने टर्न आर्काइव करें (~10% अतिरिक्त जगह)",
- compactionStyleRolling5: "पुराने टर्न आर्काइव करें (~5% अतिरिक्त जगह)",
- compactionStyleRollingNone: "पुराने टर्न आर्काइव करें (कोई अतिरिक्त कटौती नहीं)",
autoCompactKeywords:
"कॉम्पैक्शन कॉम्पैक्ट कॉन्टेक्स्ट विंडो ट्रंकेट स्लाइडिंग चेकपॉइंट हेडरूम आर्काइव पुनर्प्राप्ति खोज compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 4eee258bd6d..62650faee8b 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -1531,11 +1531,6 @@ export const it = {
"Il testo incollato di almeno {count} caratteri diventa un allegato .txt. Il testo più breve resta nel campo del messaggio.",
pastedTextOffDescription:
"Tutto il testo incollato resta nel campo del messaggio, indipendentemente dalla lunghezza.",
- compactionDescriptionInherit: "Segue la politica del contesto del server.",
- compactionDescriptionCheckpoint:
- "Mantiene l’ultimo scambio e le istruzioni permanenti che rientrano, e archivia il resto per poterlo recuperare.",
- compactionDescriptionRolling:
- "Archivia i turni più vecchi per conservare la cronologia recente e lo spazio aggiuntivo selezionato.",
projectsSection: "Mostra la sezione Progetti",
projectsSectionDescription:
"Raggruppa le chat di progetto sotto un titolo Progetti. Disattivalo per elencarle in Recenti.",
@@ -1584,19 +1579,6 @@ export const it = {
autoCompact: "Compatta automaticamente le chat lunghe",
autoCompactDescription:
"I turni più vecchi passano in un archivio consultabile quando una chat riempie il contesto.",
- compactionStyle: "Quando il contesto è pieno",
- compactionStyleDescription:
- "Il valore predefinito del server mantiene UNSLOTH_CONTEXT_POLICY. Reimpostare la conversazione conserva l'ultimo turno e le istruzioni permanenti che rientrano. Una finestra scorrevole elimina i turni più vecchi e può conservare più cronologia recente.",
- compactionStyleInherit: "Usa il valore del server",
- compactionStyleCheckpoint: "Reimposta la conversazione",
- compactionStyleRollingDefault:
- "Archivia i turni precedenti (~25% di spazio aggiuntivo)",
- compactionStyleRolling10:
- "Archivia i turni precedenti (~10% di spazio aggiuntivo)",
- compactionStyleRolling5:
- "Archivia i turni precedenti (~5% di spazio aggiuntivo)",
- compactionStyleRollingNone:
- "Archivia i turni precedenti (nessun taglio aggiuntivo)",
autoCompactKeywords:
"compattazione automatica contesto finestra troncare scorrevole checkpoint margine archivio recupero ricerca compaction rolling headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index 0479f8c8b3c..8dc8277a4a6 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -1516,10 +1516,6 @@ export const ja = {
"{count}文字以上の貼り付けテキストは .txt 添付ファイルになります。短いテキストは入力欄に残ります。",
pastedTextOffDescription:
"長さに関係なく、貼り付けたテキストはすべて入力欄に残ります。",
- compactionDescriptionInherit: "サーバーのコンテキストポリシーに従います。",
- compactionDescriptionCheckpoint: "最新のやり取りと、収まる範囲の継続的な指示を保持し、残りは検索できるようアーカイブします。",
- compactionDescriptionRolling:
- "古いターンをアーカイブし、最近の履歴と選択した余裕分の空きを確保します。",
projectsSection: "プロジェクトセクションを表示",
projectsSectionDescription:
"プロジェクトのチャットを「プロジェクト」の見出しにまとめます。オフにすると「最近」に表示されます。",
@@ -1566,15 +1562,6 @@ export const ja = {
autoCompact: "長いチャットを自動圧縮",
autoCompactDescription:
"チャットの文脈が満杯になると、古いターンは検索可能なアーカイブに移ります。",
- compactionStyle: "コンテキストが満杯になったとき",
- compactionStyleDescription:
- "サーバー既定値を使うと UNSLOTH_CONTEXT_POLICY が維持されます。会話をリセットすると最新ターンと、収まる範囲の継続指示が残ります。スライディングウィンドウは古いターンを削除し、より多くの最近の履歴を残せます。",
- compactionStyleInherit: "サーバー既定値を使用",
- compactionStyleCheckpoint: "会話をリセット",
- compactionStyleRollingDefault: "古いターンをアーカイブ(約 25% の追加余裕)",
- compactionStyleRolling10: "古いターンをアーカイブ(約 10% の追加余裕)",
- compactionStyleRolling5: "古いターンをアーカイブ(約 5% の追加余裕)",
- compactionStyleRollingNone: "古いターンをアーカイブ(追加の切り詰めなし)",
autoCompactKeywords:
"圧縮 自動圧縮 コンテキスト ウィンドウ 切り詰め スライディング チェックポイント 余裕 アーカイブ 検索 取得 compaction rolling headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index 24291758d7e..2bf1374469f 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -1526,11 +1526,6 @@ export const ko = {
"붙여넣은 텍스트가 {count}자 이상이면 .txt 첨부 파일이 됩니다. 더 짧은 텍스트는 입력창에 남습니다.",
pastedTextOffDescription:
"길이와 관계없이 붙여넣은 모든 텍스트가 입력창에 남습니다.",
- compactionDescriptionInherit: "서버의 컨텍스트 정책을 따릅니다.",
- compactionDescriptionCheckpoint:
- "최신 대화 턴과 들어갈 수 있는 만큼의 계속 적용되는 지침을 유지하고, 나머지는 검색할 수 있도록 보관합니다.",
- compactionDescriptionRolling:
- "가장 오래된 턴을 보관소로 옮겨 최근 기록을 유지하고 선택한 만큼의 여유 공간을 확보합니다.",
projectsSection: "프로젝트 섹션 표시",
projectsSectionDescription:
"프로젝트 채팅을 프로젝트 제목 아래에 모읍니다. 끄면 최근 항목에 표시됩니다.",
@@ -1578,15 +1573,6 @@ export const ko = {
autoCompact: "긴 채팅 자동 압축",
autoCompactDescription:
"채팅이 컨텍스트를 모두 채우면 오래된 턴은 검색 가능한 보관소로 옮겨집니다.",
- compactionStyle: "컨텍스트가 가득 찼을 때",
- compactionStyleDescription:
- "서버 기본값을 사용하면 UNSLOTH_CONTEXT_POLICY가 유지됩니다. 대화 재설정은 최신 턴과 들어갈 수 있는 만큼의 지속 지침을 남깁니다. 슬라이딩 윈도우는 가장 오래된 턴을 삭제하고 최근 기록을 더 많이 유지할 수 있습니다.",
- compactionStyleInherit: "서버 기본값 사용",
- compactionStyleCheckpoint: "대화 재설정",
- compactionStyleRollingDefault: "오래된 턴 보관(약 25% 추가 여유)",
- compactionStyleRolling10: "오래된 턴 보관(약 10% 추가 여유)",
- compactionStyleRolling5: "오래된 턴 보관(약 5% 추가 여유)",
- compactionStyleRollingNone: "오래된 턴 보관(추가 잘라내기 없음)",
autoCompactKeywords:
"압축 자동 컨텍스트 윈도우 자르기 슬라이딩 체크포인트 여유 보관 검색 회수 compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index 16467228fdd..43ed40b2bc6 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -1545,11 +1545,6 @@ export const ptBR = {
"Texto colado com {count} caracteres ou mais vira um anexo .txt. Textos menores ficam na caixa de mensagem.",
pastedTextOffDescription:
"Todo o texto colado fica na caixa de mensagem, independentemente do tamanho.",
- compactionDescriptionInherit: "Segue a política de contexto do servidor.",
- compactionDescriptionCheckpoint:
- "Mantém a última troca de mensagens e as instruções permanentes que couberem, e arquiva o restante para consulta.",
- compactionDescriptionRolling:
- "Arquiva os turnos mais antigos para manter o histórico recente e o espaço extra selecionado.",
projectsSection: "Mostrar a seção Projetos",
projectsSectionDescription:
"Agrupa as conversas de projeto sob um título Projetos. Desative para listá-las em Recentes.",
@@ -1597,19 +1592,6 @@ export const ptBR = {
autoCompact: "Compactar automaticamente chats longos",
autoCompactDescription:
"Os turnos antigos vão para um arquivo pesquisável quando um chat enche o contexto.",
- compactionStyle: "Quando o contexto estiver cheio",
- compactionStyleDescription:
- "Usar o padrão do servidor preserva UNSLOTH_CONTEXT_POLICY. Redefinir a conversa mantém o turno mais recente e as instruções permanentes que couberem. Uma janela deslizante descarta os turnos mais antigos e pode manter mais histórico recente.",
- compactionStyleInherit: "Usar padrão do servidor",
- compactionStyleCheckpoint: "Redefinir conversa",
- compactionStyleRollingDefault:
- "Arquivar turnos antigos (~25% de espaço extra)",
- compactionStyleRolling10:
- "Arquivar turnos antigos (~10% de espaço extra)",
- compactionStyleRolling5:
- "Arquivar turnos antigos (~5% de espaço extra)",
- compactionStyleRollingNone:
- "Arquivar turnos antigos (sem corte extra)",
autoCompactKeywords:
"compactação compactar automaticamente contexto janela truncar deslizante checkpoint margem arquivo recuperação busca compaction rolling headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 16976dc630b..55776ed9322 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -1542,11 +1542,6 @@ export const ru = {
"Вставленный текст длиной от {count} символов становится вложением .txt. Более короткий текст остаётся в поле сообщения.",
pastedTextOffDescription:
"Весь вставленный текст остаётся в поле сообщения независимо от длины.",
- compactionDescriptionInherit: "Использует политику контекста сервера.",
- compactionDescriptionCheckpoint:
- "Сохраняет последний обмен сообщениями и те постоянные инструкции, которые помещаются, а остальное отправляет в архив для поиска.",
- compactionDescriptionRolling:
- "Архивирует самые старые реплики, сохраняя недавнюю историю и выбранный запас свободного места.",
projectsSection: "Показывать раздел «Проекты»",
projectsSectionDescription:
"Группирует чаты проектов под заголовком «Проекты». Отключите, чтобы они отображались в «Недавних».",
@@ -1594,19 +1589,6 @@ export const ru = {
autoCompact: "Автоматически сжимать длинные чаты",
autoCompactDescription:
"Старые ходы уходят в доступный для поиска архив, когда чат заполняет контекст.",
- compactionStyle: "Когда контекст заполнен",
- compactionStyleDescription:
- "Настройка сервера сохраняет UNSLOTH_CONTEXT_POLICY. Сброс беседы оставляет последний ход и те постоянные инструкции, которые помещаются. Скользящее окно удаляет самые старые ходы и может сохранить больше недавней истории.",
- compactionStyleInherit: "Использовать настройку сервера",
- compactionStyleCheckpoint: "Сбросить беседу",
- compactionStyleRollingDefault:
- "Архивировать старые ходы (~25% дополнительного места)",
- compactionStyleRolling10:
- "Архивировать старые ходы (~10% дополнительного места)",
- compactionStyleRolling5:
- "Архивировать старые ходы (~5% дополнительного места)",
- compactionStyleRollingNone:
- "Архивировать старые ходы (без дополнительного сокращения)",
autoCompactKeywords:
"сжатие автоматически контекст окно обрезка скользящее контрольная точка запас архив поиск извлечение compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index ec1ffee32c2..7a962a7b076 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -1497,10 +1497,6 @@ export const zhCN = {
"粘贴的文本达到 {count} 个字符时会转为 .txt 附件,较短的文本则保留在消息输入框中。",
pastedTextOffDescription:
"无论长度如何,粘贴的文本都会保留在消息输入框中。",
- compactionDescriptionInherit: "遵循服务器的上下文策略。",
- compactionDescriptionCheckpoint: "保留最新一轮对话和放得下的持续生效指令,其余内容归档以便检索。",
- compactionDescriptionRolling:
- "归档最早的对话轮次,保留近期记录并预留所选的额外空间。",
projectsSection: "显示项目分区",
projectsSectionDescription:
"将项目对话归到「项目」标题下。关闭后改为显示在「最近」中。",
@@ -1547,15 +1543,6 @@ export const zhCN = {
autoCompact: "自动压缩长聊天",
autoCompactDescription:
"聊天填满上下文时,较早的轮次会转入可检索的归档。",
- compactionStyle: "上下文已满时",
- compactionStyleDescription:
- "使用服务器默认值会保留 UNSLOTH_CONTEXT_POLICY。重置对话会保留最新轮次和放得下的持续指令。滑动窗口会丢弃最早的轮次,并可保留更多近期历史。",
- compactionStyleInherit: "使用服务器默认值",
- compactionStyleCheckpoint: "重置对话",
- compactionStyleRollingDefault: "归档最早的轮次(约 25% 额外空间)",
- compactionStyleRolling10: "归档最早的轮次(约 10% 额外空间)",
- compactionStyleRolling5: "归档最早的轮次(约 5% 额外空间)",
- compactionStyleRollingNone: "归档最早的轮次(不额外裁剪)",
autoCompactKeywords:
"压缩 自动压缩 上下文 窗口 截断 滑动 检查点 余量 归档 检索 搜索 compaction rolling checkpoint headroom archive retrieval rag",
thinking: {
diff --git a/studio/frontend/tests/auto-compaction-settings.test.ts b/studio/frontend/tests/auto-compaction-settings.test.ts
index 92386143d41..c5963326a2c 100644
--- a/studio/frontend/tests/auto-compaction-settings.test.ts
+++ b/studio/frontend/tests/auto-compaction-settings.test.ts
@@ -3,112 +3,53 @@
import assert from "node:assert/strict";
import test from "node:test";
-import {
- DEFAULT_CONTEXT_POLICY,
- compactionStyleValue,
- ggufCompactionRequestFields,
- parseCompactionStyle,
- sanitizeCompactionHeadroomRatio,
-} from "../src/features/chat/utils/auto-compaction.ts";
+import { ggufCompactionRequestFields } from "../src/features/chat/utils/auto-compaction.ts";
import { readSrc } from "./helpers/kit.ts";
-test("the default preserves the server context policy", () => {
- assert.equal(DEFAULT_CONTEXT_POLICY, "inherit");
- assert.equal(compactionStyleValue("inherit", 0.25), "inherit");
- assert.deepEqual(parseCompactionStyle("inherit"), {
- contextPolicy: "inherit",
- compactionHeadroomRatio: 0.25,
- });
+test("auto-compact on sends truncate_oldest and no policy of its own", () => {
+ // No context_policy: the server applies UNSLOTH_CONTEXT_POLICY. Studio used to offer that
+ // choice as a setting and no longer does, so this is the only shape an enabled request takes.
assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: true,
- autoCompactEnabled: true,
- contextPolicy: "inherit",
- compactionHeadroomRatio: 0.25,
- }),
+ ggufCompactionRequestFields({ isGguf: true, autoCompactEnabled: true }),
{ context_overflow: "truncate_oldest" },
);
});
test("auto-compact off sends an explicit error overflow policy", () => {
assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: true,
- autoCompactEnabled: false,
- contextPolicy: "checkpoint",
- compactionHeadroomRatio: 0.25,
- }),
+ ggufCompactionRequestFields({ isGguf: true, autoCompactEnabled: false }),
{ context_overflow: "error" },
);
});
-test("checkpoint compaction sends truncate_oldest and the checkpoint policy", () => {
- assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: true,
- autoCompactEnabled: true,
- contextPolicy: "checkpoint",
- compactionHeadroomRatio: 0.25,
- }),
- { context_overflow: "truncate_oldest", context_policy: "checkpoint" },
- );
-});
-
-test("a sliding window sends rolling policy and the extra-trim ratio", () => {
- assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: true,
- autoCompactEnabled: true,
- contextPolicy: "rolling",
- compactionHeadroomRatio: 0.05,
- }),
- {
- context_overflow: "truncate_oldest",
- context_policy: "rolling",
- compaction_headroom_ratio: 0.05,
- },
- );
-});
-
test("external models never opt into GGUF compaction", () => {
assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: false,
- autoCompactEnabled: true,
- contextPolicy: "rolling",
- compactionHeadroomRatio: 0,
- }),
+ ggufCompactionRequestFields({ isGguf: false, autoCompactEnabled: true }),
{},
);
});
-test("the settings select round-trips style values", () => {
- assert.equal(compactionStyleValue("checkpoint", 0.25), "checkpoint");
- assert.equal(compactionStyleValue("rolling", 0), "rolling:0");
- assert.deepEqual(parseCompactionStyle("rolling:0.1"), {
- contextPolicy: "rolling",
- compactionHeadroomRatio: 0.1,
- });
-});
-
-test("unsupported headroom ratios snap to an exposed choice", () => {
- assert.equal(sanitizeCompactionHeadroomRatio(0.9), 0.25);
- assert.equal(sanitizeCompactionHeadroomRatio(0.07), 0.05);
- assert.equal(compactionStyleValue("rolling", 0.9), "rolling:0.25");
- assert.deepEqual(
- ggufCompactionRequestFields({
- isGguf: true,
- autoCompactEnabled: true,
- contextPolicy: "rolling",
- compactionHeadroomRatio: 0.9,
- }),
- {
- context_overflow: "truncate_oldest",
- context_policy: "rolling",
- compaction_headroom_ratio: 0.25,
- },
- );
+test("nothing still offers the removed compaction style", () => {
+ // The row is gone, so its state, its request fields and its strings should be too: a leftover
+ // setter or key is a setting the user cannot reach but the code still carries.
+ for (const file of [
+ "features/settings/tabs/chat-tab.tsx",
+ "features/chat/stores/chat-runtime-store.ts",
+ "features/chat/utils/chat-settings-storage.ts",
+ "features/chat/utils/queued-chat-run-settings.ts",
+ "features/chat/api/chat-settings-api.ts",
+ "features/chat/api/chat-adapter.ts",
+ "features/chat/utils/auto-compaction.ts",
+ "features/settings/settings-search.ts",
+ "i18n/locales/en.ts",
+ ]) {
+ assert.doesNotMatch(
+ readSrc(file),
+ /contextPolicy|compactionHeadroomRatio|compactionStyle|compactionDescription/,
+ `${file} still carries the removed compaction style`,
+ );
+ }
});
test("the chat adapter sends compaction fields through the shared helper", () => {
@@ -146,8 +87,6 @@ test("a queued run keeps its own model's llama.cpp verdict after the picker move
loadedIsGguf: true,
loadedContextLength: 8192,
autoCompactEnabled: true,
- contextPolicy: "rolling" as const,
- compactionHeadroomRatio: 0.1,
};
const queued = snapshotQueuedChatRunSettings(
resident as unknown as Parameters<typeof snapshotQueuedChatRunSettings>[0],
@@ -175,13 +114,7 @@ test("a queued run keeps its own model's llama.cpp verdict after the picker move
ggufCompactionRequestFields({
isGguf,
autoCompactEnabled: runtime.autoCompactEnabled,
- contextPolicy: runtime.contextPolicy,
- compactionHeadroomRatio: runtime.compactionHeadroomRatio,
}),
- {
- context_overflow: "truncate_oldest",
- context_policy: "rolling",
- compaction_headroom_ratio: 0.1,
- },
+ { context_overflow: "truncate_oldest" },
);
});