From 1da0adcbe836de5f7d4ff05e77ebadaa7e41b893 Mon Sep 17 00:00:00 2001 From: justsisyphus Date: Wed, 28 Jan 2026 13:31:11 +0900 Subject: [PATCH] feat(index): add provider cache missing warning toast Show warning toast when hasConnectedProvidersCache() returns false, indicating model filtering is disabled. Prompts user to restart OpenCode for full functionality. --- src/index.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 48e6123d7..c8b8b6862 100644 --- a/src/index.ts +++ b/src/index.ts @@ -78,7 +78,7 @@ import { SkillMcpManager } from "./features/skill-mcp-manager"; import { initTaskToastManager } from "./features/task-toast-manager"; import { TmuxSessionManager } from "./features/tmux-subagent"; import { type HookName } from "./config"; -import { log, detectExternalNotificationPlugin, getNotificationConflictWarning, resetMessageCursor, includesCaseInsensitive } from "./shared"; +import { log, detectExternalNotificationPlugin, getNotificationConflictWarning, resetMessageCursor, includesCaseInsensitive, hasConnectedProvidersCache } from "./shared"; import { loadPluginConfig } from "./plugin-config"; import { createModelCacheState, getModelLimit } from "./plugin-state"; import { createConfigHandler } from "./plugin-handlers"; @@ -398,6 +398,17 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await autoSlashCommand?.["chat.message"]?.(input, output); await startWork?.["chat.message"]?.(input, output); + if (!hasConnectedProvidersCache()) { + ctx.client.tui.showToast({ + body: { + title: "⚠️ Provider Cache Missing", + message: "Model filtering disabled. RESTART OpenCode to enable full functionality.", + variant: "warning" as const, + duration: 6000, + }, + }).catch(() => {}); + } + if (ralphLoop) { const parts = ( output as { parts?: Array<{ type: string; text?: string }> }