Commit f05ab4a
fix: resolve provider icon sync failures (v1.6.1)
Three bugs prevented provider icons from reliably appearing in the
OpenWebUI model selector:
1. Wrong lookup order in _get_provider_icon: the hardcoded
_PROVIDER_ICONS dict was always consulted before the dynamic
OpenRouter registry. If OpenRouter changed any CDN path, the
hardcoded (stale) URL was returned and served 404s while the
registry — which always has current paths — was ignored for
those providers. Fix: registry-first, hardcoded as fallback.
2. _provider_registry cached forever: a transient fetch failure
at startup (network not ready, rate-limited, API hiccup) would
leave the registry permanently empty until the pipe restarted.
Non-200 responses were also silently ignored. Fix: added a 1h
TTL (_PROVIDER_REGISTRY_TTL) and a log message for non-200s.
3. _icons_synced never reset: the set tracking "already synced"
model IDs was never cleared between 5-minute model-cache
refreshes. OWUI upserts models with the default data: icon
after every pipes() call; the permanent _icons_synced state
meant that any OWUI-overwritten icon was never restored. Fix:
clear _icons_synced whenever the model cache is refreshed.
Tests: 555 passed (6 new assertions covering the three fixes).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 19d6abb commit f05ab4a
3 files changed
Lines changed: 107 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
10 | 19 | | |
11 | 20 | | |
12 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
652 | 657 | | |
653 | 658 | | |
654 | 659 | | |
655 | | - | |
| 660 | + | |
656 | 661 | | |
| 662 | + | |
657 | 663 | | |
658 | 664 | | |
659 | 665 | | |
| |||
874 | 880 | | |
875 | 881 | | |
876 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
877 | 888 | | |
878 | 889 | | |
879 | 890 | | |
| |||
1119 | 1130 | | |
1120 | 1131 | | |
1121 | 1132 | | |
1122 | | - | |
| 1133 | + | |
1123 | 1134 | | |
1124 | 1135 | | |
1125 | 1136 | | |
1126 | | - | |
1127 | | - | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1128 | 1142 | | |
1129 | | - | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
1130 | 1148 | | |
1131 | 1149 | | |
1132 | 1150 | | |
| |||
1153 | 1171 | | |
1154 | 1172 | | |
1155 | 1173 | | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
1156 | 1179 | | |
1157 | 1180 | | |
1158 | 1181 | | |
1159 | 1182 | | |
1160 | 1183 | | |
1161 | 1184 | | |
| 1185 | + | |
1162 | 1186 | | |
1163 | 1187 | | |
1164 | 1188 | | |
1165 | 1189 | | |
1166 | 1190 | | |
1167 | | - | |
1168 | | - | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
1169 | 1196 | | |
1170 | 1197 | | |
1171 | 1198 | | |
1172 | 1199 | | |
1173 | | - | |
| 1200 | + | |
| 1201 | + | |
1174 | 1202 | | |
1175 | 1203 | | |
1176 | | - | |
1177 | | - | |
| 1204 | + | |
1178 | 1205 | | |
1179 | 1206 | | |
1180 | 1207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
2108 | 2109 | | |
2109 | 2110 | | |
2110 | 2111 | | |
2111 | | - | |
| 2112 | + | |
| 2113 | + | |
2112 | 2114 | | |
2113 | 2115 | | |
2114 | 2116 | | |
2115 | | - | |
| 2117 | + | |
2116 | 2118 | | |
2117 | 2119 | | |
2118 | 2120 | | |
| |||
2139 | 2141 | | |
2140 | 2142 | | |
2141 | 2143 | | |
2142 | | - | |
| 2144 | + | |
2143 | 2145 | | |
2144 | 2146 | | |
2145 | 2147 | | |
| |||
2151 | 2153 | | |
2152 | 2154 | | |
2153 | 2155 | | |
2154 | | - | |
| 2156 | + | |
2155 | 2157 | | |
2156 | | - | |
| 2158 | + | |
2157 | 2159 | | |
2158 | 2160 | | |
2159 | 2161 | | |
| |||
2165 | 2167 | | |
2166 | 2168 | | |
2167 | 2169 | | |
2168 | | - | |
| 2170 | + | |
2169 | 2171 | | |
2170 | 2172 | | |
2171 | 2173 | | |
2172 | 2174 | | |
2173 | 2175 | | |
2174 | 2176 | | |
2175 | | - | |
2176 | | - | |
2177 | | - | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
2178 | 2229 | | |
2179 | 2230 | | |
2180 | 2231 | | |
| |||
0 commit comments