Commit 63902f7
committed
Jetpack AI: guard every model-supplied list the review card indexes
affected_blocks was not the only one. conflict.positions and
edit.supported_by_reviewers are typed as required by the tool schema, but the
provider drops `strict`, so the model can omit either. Both are indexed
unguarded, so either one throws the same TypeError and unmounts the card.
A single toList() helper replaces the inline guard, so all three sites read the
same way and a new one is a one-liner rather than a guard to remember. The three
fields are now optional on the interface, which is what the payload actually
promises.1 parent a94b8fb commit 63902f7
2 files changed
Lines changed: 53 additions & 8 deletions
File tree
- packages/jetpack-ai-sidebar/src/components
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
468 | 505 | | |
469 | 506 | | |
470 | 507 | | |
| |||
Lines changed: 16 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
| |||
1282 | 1291 | | |
1283 | 1292 | | |
1284 | 1293 | | |
1285 | | - | |
| 1294 | + | |
1286 | 1295 | | |
1287 | 1296 | | |
1288 | 1297 | | |
| |||
1391 | 1400 | | |
1392 | 1401 | | |
1393 | 1402 | | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
| 1403 | + | |
1397 | 1404 | | |
1398 | 1405 | | |
1399 | 1406 | | |
| |||
1515 | 1522 | | |
1516 | 1523 | | |
1517 | 1524 | | |
| 1525 | + | |
1518 | 1526 | | |
1519 | | - | |
| 1527 | + | |
1520 | 1528 | | |
1521 | 1529 | | |
1522 | | - | |
| 1530 | + | |
1523 | 1531 | | |
1524 | 1532 | | |
1525 | 1533 | | |
| |||
0 commit comments