Repository navigation
Commit 9185309
committed
fix: treat released=0 as unknown date to keep config models visible
Models declared in opencode.jsonc that the server does not have a
release date for are emitted with time.released=0. Mapping 0 to
new Date(0) produces the ISO string "1970-01-01", which is a valid
Luxon DateTime. The visibility filter in models.tsx only shows models
whose release date is within the past 6 months or whose date is
invalid/unknown. With a valid 1970-01-01 date the model fell into the
"hidden by default" branch and never appeared in the model picker,
even though the user had explicitly configured it.
Fix: when model.time.released === 0, set release_date to undefined
instead. That makes date?.isValid falsy in the visibility guard,
which triggers the "return true" escape hatch and keeps the model
visible.
Also adds a dedicated regression test to normalizeProviderList covering
active models with released=0 asserting release_date is undefined.
Fixes: anomalyco#496051 parent 5a83358 commit 9185309
2 files changed
Lines changed: 35 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
121 | 151 | | |
122 | 152 | | |
123 | 153 | | |
| |||
135 | 165 | | |
136 | 166 | | |
137 | 167 | | |
138 | | - | |
| 168 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
0 commit comments