feat: show warning toast when model cache is not available

- Added isModelCacheAvailable() to check if cache file exists
- Shows warning toast on session start if cache is missing
- Suggests running 'opencode models --refresh' or restarting
This commit is contained in:
justsisyphus
2026-01-23 14:20:38 +09:00
parent ab3e622baa
commit e16bbbcc05
2 changed files with 24 additions and 0 deletions
+5
View File
@@ -147,3 +147,8 @@ export async function fetchAvailableModels(_client?: any): Promise<Set<string>>
export function __resetModelCache(): void {
cachedModels = null
}
export function isModelCacheAvailable(): boolean {
const cacheFile = join(getOpenCodeCacheDir(), "models.json")
return existsSync(cacheFile)
}