Commit fb119d8
authored
fix(sessions): refresh model from registry on session restore (#502)
Persisted sessions store the full model object including contextWindow.
After a dependency bump that updates registry metadata (e.g. Opus 4.6
going from 200k to 1M context), restored sessions would still show the
old value because setModel() received the stale persisted object.
Now re-resolve the model from getModel(provider, id) on restore, picking
up the latest contextWindow, pricing, and other metadata. Falls back to
the persisted model for custom-gateway models not in the registry.1 parent 87058ac commit fb119d8
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
45 | 63 | | |
46 | 64 | | |
47 | 65 | | |
| |||
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
284 | | - | |
| 302 | + | |
285 | 303 | | |
286 | 304 | | |
287 | 305 | | |
| |||
0 commit comments