Commit 1c5fd39
authored
fix: stop treating a model list as an allowlist (#3330)
* fix(core,runtime,runtime-host,storage): stop treating a model list as an allowlist
A Volcengine Ark Agent Plan key could not select the models its own plan
serves. The plan's key reaches only the inference data plane, so Maka had
no way to enumerate the account and fell back to the array this build
ships. Every gate then read that array as the set of models the account
has, and refused everything else.
The array is not that set, and no array Maka holds is. A `/models`
response describes one call at one moment, scoped to whatever the
provider chose to report; a shipped snapshot describes the provider, not
the account; and four providers have no list endpoint at all. Only the
user knows what their account can run, and only the provider can settle
it — by answering the request.
So the allowlist goes, rather than growing another exception:
- `authorizeConnectionModel` in `llm-connections.ts` is the one seam that
answers "can this connection run this model". The user's selection is
the authorization. The observed row still wins wherever it exists, for
its wire metadata and capabilities, but its absence authorizes nothing
and vetoes nothing.
- A fetch no longer prunes what the user chose. `reconcileConnectionAfterModelFetch`
seeds a first default only for a connection that has never had a list
to pick from, and otherwise returns the selection untouched.
- `filterDiscoveredModels` no longer intersects a live response with the
shipped snapshot, which was silently dropping models from six
providers whose real catalogs outgrew it.
- Readiness, the connection probe, the hosted execution target and the
catalog coordinator all consult that one seam. `connection-model-admission.ts`
and its hardcoded DeepSeek exception are deleted.
What the picker SAYS is unchanged in spirit and now purely advisory:
`classifyConnectionModelInventory` still separates a live response from a
snapshot, and a model the live response omitted is annotated
`not_in_live_list` — a warning the user can act on, not a refusal.
Fixes #1584
Generated-by: Claude Code
* feat(core,runtime,desktop): let a user state the model facts Maka cannot learn
Once a model no catalog lists is selectable, the user needs somewhere to
put what they know about it, and a way to add it in the first place.
Model declarations (`relayModelProfiles`) already existed but were
refused on any non-relay connection. That gate split the wrong way. It
turns on the FIELD, not the provider:
- `contextWindow` and `vision` state facts about a model. A user has them
whenever Maka does not — a model newer than the bundled snapshot, or
any model on a provider with no model-list endpoint — so they are legal
on every provider.
- `thinkingLevels` and `serviceTier` name a wire feature instead
(`reasoning_effort` tiers, priority processing) that only the
OpenAI-compatible relays accept, and stay relay-only. Declaring them
elsewhere would describe a request Maka never sends, or draw a 400 the
user cannot explain.
`assertProfileFieldsFitProvider` in the catalog codec is the single write
seam for that rule, so the read paths do not re-derive it.
On the settings side, a connection detail page now offers "Add model"
alongside "Update models" rather than instead of it: the two answer
different questions, and a provider that supports discovery can still
serve a model its discovery did not report. The dialog takes an id plus
the optional declarations above.
The field name stays `relayModelProfiles` — renaming a persisted field is
a migration this change does not need — and its doc comment now explains
that the name is historical.
Generated-by: Claude Code
* fix(desktop): hold the add-model draft until the write lands
The dialog closed on submit and cleared both fields while the write was
still in flight, so a rejection left the user with a toast and nothing to
retry from — and an exact model id is not something anyone reproduces
from memory, which is the whole reason this dialog asks for one.
`addDeclaredModel` now returns whether the write landed, matching `save`
and `saveRelayProfiles` in the same hook, and the dialog closes only on
success. While the write is in flight the confirm button shows a saving
state and dismissal is refused, as in `goal-dialog`.
Generated-by: Claude Code1 parent e44ddce commit 1c5fd39
36 files changed
Lines changed: 1341 additions & 405 deletions
File tree
- apps/desktop
- src/renderer
- locales
- settings
- stories/settings
- docs
- packages
- core/src
- __tests__
- runtime-policy
- runtime-host/src
- __tests__
- client
- server
- runtime/src
- __tests__
- storage/src
- __tests__
- runtime-policy
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
72 | 82 | | |
73 | 83 | | |
74 | 84 | | |
| |||
205 | 215 | | |
206 | 216 | | |
207 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
208 | 229 | | |
209 | 230 | | |
210 | 231 | | |
| |||
Lines changed: 152 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 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 | + | |
Lines changed: 50 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| 154 | + | |
152 | 155 | | |
153 | 156 | | |
154 | 157 | | |
| |||
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
170 | 178 | | |
171 | 179 | | |
172 | 180 | | |
173 | 181 | | |
174 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
175 | 189 | | |
176 | 190 | | |
177 | 191 | | |
178 | 192 | | |
179 | 193 | | |
| 194 | + | |
180 | 195 | | |
181 | 196 | | |
182 | 197 | | |
| |||
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
524 | 545 | | |
525 | 546 | | |
526 | 547 | | |
| 548 | + | |
527 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
528 | 564 | | |
529 | 565 | | |
530 | 566 | | |
| |||
568 | 604 | | |
569 | 605 | | |
570 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
571 | 613 | | |
572 | 614 | | |
573 | 615 | | |
| |||
609 | 651 | | |
610 | 652 | | |
611 | 653 | | |
| 654 | + | |
612 | 655 | | |
613 | 656 | | |
614 | 657 | | |
| |||
Lines changed: 66 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
247 | 248 | | |
248 | 249 | | |
249 | 250 | | |
| |||
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
487 | 552 | | |
488 | 553 | | |
489 | 554 | | |
| |||
653 | 718 | | |
654 | 719 | | |
655 | 720 | | |
| 721 | + | |
656 | 722 | | |
657 | 723 | | |
658 | 724 | | |
| |||
0 commit comments