mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 00:02:03 +00:00
feat(ai-chat): hint /compact in context usage tooltip (#9777)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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}
|
||||
<p class="mt-1 text-tertiary">History will be compacted soon to free up space.</p>
|
||||
{/if}
|
||||
{#if canCompact}
|
||||
<p class="mt-1 text-tertiary">
|
||||
Type <span class="font-mono">/compact</span> to summarize and free up space now.
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{/snippet}
|
||||
</Tooltip>
|
||||
|
||||
Reference in New Issue
Block a user