diff --git a/frontend/src/lib/components/copilot/chat/ContextUsageIndicator.svelte b/frontend/src/lib/components/copilot/chat/ContextUsageIndicator.svelte index 104f418031..80b317ba12 100644 --- a/frontend/src/lib/components/copilot/chat/ContextUsageIndicator.svelte +++ b/frontend/src/lib/components/copilot/chat/ContextUsageIndicator.svelte @@ -2,10 +2,15 @@ import { copilotInfo, copilotSessionModel } from '$lib/aiStore' import { getKnownModelContextWindow } from '../modelConfig' import { getAiChatManager } from './aiChatManagerContext' + import { AIMode } from './AIChatManager.svelte' import Tooltip from '$lib/components/meltComponents/Tooltip.svelte' const aiChatManager = getAiChatManager() + // The `/compact` slash command is only wired up in session-chat GLOBAL mode, + // so only advertise it where it actually works. + let canCompact = $derived(aiChatManager.isSessionChat && aiChatManager.mode === AIMode.GLOBAL) + let providerModel = $derived( $copilotSessionModel ?? $copilotInfo.defaultModel ?? $copilotInfo.aiModels[0] ) @@ -75,6 +80,11 @@ {#if ratio !== undefined && ratio >= COMPACTION_TRIGGER_RATIO}
History will be compacted soon to free up space.
{/if} + {#if canCompact} ++ Type /compact to summarize and free up space now. +
+ {/if} {/snippet}