Repository navigation
Commit c166c4c
fix: extract balanced JSON arrays from prose responses
Previously extractBalancedJsonObject only scanned for '{...}' objects.
Agents with array output schemas (s.array(...)) would fail to parse
responses where the model embedded the JSON array in surrounding prose,
triggering an unnecessary repair turn.
Rename to extractBalancedJson and pick whichever container character
({ or [) appears first, so both objects and arrays are handled.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 75f579f commit c166c4c
2 files changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1284 | 1284 | | |
1285 | 1285 | | |
1286 | 1286 | | |
1287 | | - | |
| 1287 | + | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | | - | |
| 1332 | + | |
1333 | 1333 | | |
1334 | | - | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1335 | 1340 | | |
1336 | 1341 | | |
1337 | 1342 | | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
1338 | 1346 | | |
1339 | 1347 | | |
1340 | 1348 | | |
1341 | | - | |
| 1349 | + | |
1342 | 1350 | | |
1343 | 1351 | | |
1344 | 1352 | | |
| |||
1356 | 1364 | | |
1357 | 1365 | | |
1358 | 1366 | | |
1359 | | - | |
| 1367 | + | |
1360 | 1368 | | |
1361 | | - | |
| 1369 | + | |
1362 | 1370 | | |
1363 | 1371 | | |
1364 | | - | |
| 1372 | + | |
1365 | 1373 | | |
1366 | 1374 | | |
1367 | 1375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
425 | 436 | | |
426 | 437 | | |
427 | 438 | | |
| |||
0 commit comments