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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user