Commit 313094b
committed
fix(models): Fix GGUF models not appearing in picker after download
**Problem:**
Downloaded GGUF models via Model Manager did not appear in picker until SAM restart.
User had to manually restart to see newly downloaded models.
**Root Cause:**
When downloading via ModelDownloadManager:
1. Model file downloaded and registered in registry (line 406)
2. refreshInstalledModels() called → scanForModels() (line 420)
3. scanForModels() called syncWithRegistry() to detect changes
4. syncWithRegistry() returned FALSE (model already registered in step 1!)
5. Because registryChanges=false, notifications NEVER posted
6. EndpointManager never reloaded, ModelListManager never refreshed
7. Model invisible until restart (when scanForModels runs on init)
**Solution:**
Track actual model list changes in scanForModels():
- Capture model paths before scan (previousModelPaths)
- Capture model paths after scan (currentModelPaths)
- Post notifications if EITHER registry changed OR model paths chang- Post notifications if EITHER registry changed OR model paths chang- Post notifications if EITHe build-debug co- Post notifications if EITHER registry changed OR model paths chang- Post notificate- Post notifications if EITHER registry changed OR model paact- Post notificed- Post notifications if EITHER registry cstart
- Hot reload works as originally intended
- Preserves regis- Preserves regis- Preserves regis- Preserves regis- Preserves r from Local Models redesign (20260108.1)1 parent 9796f3f commit 313094b
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
171 | 174 | | |
172 | 175 | | |
173 | 176 | | |
| |||
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
243 | | - | |
244 | | - | |
245 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
246 | 254 | | |
247 | 255 | | |
248 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
| |||
0 commit comments