Commit 3662b23
committed
Fix custom model settings state and validation
- Write back only the model fields when the edit sheet reads from
disk, instead of rebuilding the API key and base URL pickers, which
raced with an empty tag
- Give BuiltInSuggestionFeatureProvider.customModel the raw value
1000. A persisted SuggestionFeatureProvider of Int 2 now fails to
decode and falls back to the default provider, so the user has to
pick Custom Model once
- Keep the key names of the standalone app without migrating its
configuration, and treat the old chatModel value as an invalid model
- Snapshot modelId, chatModels and strategyId once in the coordinator,
save through userDefaults behind a non-empty check, and forward
cancellation to the inner task
- Populate the Completion picker from the completions list and the FIM
picker from the codestral list, and drop the unreachable googleAI
view
- Fold the three model field views into SharedModelFields, and move
RequestStrategyOption and the model lists out of the engine, so
HostApp no longer depends on CustomSuggestionService
Tests cover saving from CompletionModelEdit and the raw 1000 round
trip for SuggestionFeatureProvider. The sheet pickers were not
verified in the GUI.1 parent b5a24bf commit 3662b23
20 files changed
Lines changed: 501 additions & 349 deletions
File tree
- Core
- Sources/HostApp/AccountSettings/CustomModelSuggestion
- Tests/HostAppTests
- Tool/Sources
- AIModel
- CustomSuggestionService
- API
- Preferences
- Types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | 125 | | |
127 | 126 | | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
| |||
Lines changed: 27 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | | - | |
6 | | - | |
| 4 | + | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
20 | 17 | | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
| 21 | + | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 36 | + | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
| |||
55 | 49 | | |
56 | 50 | | |
57 | 51 | | |
| 52 | + | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
66 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
70 | | - | |
71 | | - | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
78 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
79 | 89 | | |
80 | 90 | | |
81 | 91 | | |
| |||
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
88 | | - | |
| 98 | + | |
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| |||
153 | 163 | | |
154 | 164 | | |
155 | 165 | | |
156 | | - | |
| |||
Lines changed: 37 additions & 91 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
| |||
57 | 54 | | |
58 | 55 | | |
59 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
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 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | 114 | | |
165 | 115 | | |
166 | 116 | | |
167 | 117 | | |
168 | 118 | | |
169 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
170 | 123 | | |
171 | 124 | | |
172 | 125 | | |
173 | 126 | | |
174 | 127 | | |
175 | 128 | | |
176 | 129 | | |
177 | | - | |
| 130 | + | |
178 | 131 | | |
179 | 132 | | |
180 | | - | |
181 | | - | |
| 133 | + | |
| 134 | + | |
182 | 135 | | |
183 | 136 | | |
184 | 137 | | |
185 | 138 | | |
186 | 139 | | |
187 | 140 | | |
188 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
189 | 145 | | |
190 | 146 | | |
191 | 147 | | |
| |||
198 | 154 | | |
199 | 155 | | |
200 | 156 | | |
201 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
202 | 161 | | |
203 | 162 | | |
204 | 163 | | |
205 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
206 | 168 | | |
207 | 169 | | |
208 | 170 | | |
| |||
227 | 189 | | |
228 | 190 | | |
229 | 191 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
240 | 196 | | |
241 | 197 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | 198 | | |
258 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
259 | 203 | | |
260 | 204 | | |
261 | 205 | | |
| |||
269 | 213 | | |
270 | 214 | | |
271 | 215 | | |
272 | | - | |
273 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
274 | 221 | | |
275 | 222 | | |
276 | 223 | | |
277 | | - | |
| 224 | + | |
278 | 225 | | |
279 | 226 | | |
280 | 227 | | |
| |||
321 | 268 | | |
322 | 269 | | |
323 | 270 | | |
324 | | - | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
0 commit comments