Commit 6368c11
authored
fix: guard tool event callbacks (AI-assisted) (#81696)
Summary:
- This PR wraps embedded-agent tool-handler onExecutionPhase and per-run onAgentEvent emissions in best-effort warning guards and adds regression tests for throwing and rejecting callbacks.
- PR surface: Source +31, Tests +44. Total +75 across 2 files.
- Reproducibility: yes. Current main directly invokes the relevant callbacks in the tool-start and tool-event ... sync observer can leak unless guarded; I did not run a failing current-main repro in this read-only review.
Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.
Validation:
- ClawSweeper review passed for head 65de17d.
- Required merge gates passed before the squash merge.
Prepared head SHA: 65de17d
Review: #81696 (comment)
Co-authored-by: xuyi1243 <maginaxwhz@gmail.com>1 parent dc9b1d5 commit 6368c11
2 files changed
Lines changed: 85 additions & 10 deletions
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
337 | 381 | | |
338 | 382 | | |
339 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
308 | 339 | | |
309 | 340 | | |
310 | 341 | | |
| |||
780 | 811 | | |
781 | 812 | | |
782 | 813 | | |
783 | | - | |
| 814 | + | |
784 | 815 | | |
785 | 816 | | |
786 | 817 | | |
| |||
898 | 929 | | |
899 | 930 | | |
900 | 931 | | |
901 | | - | |
| 932 | + | |
902 | 933 | | |
903 | 934 | | |
904 | 935 | | |
| |||
1037 | 1068 | | |
1038 | 1069 | | |
1039 | 1070 | | |
1040 | | - | |
| 1071 | + | |
1041 | 1072 | | |
1042 | 1073 | | |
1043 | 1074 | | |
| |||
1075 | 1106 | | |
1076 | 1107 | | |
1077 | 1108 | | |
1078 | | - | |
| 1109 | + | |
1079 | 1110 | | |
1080 | 1111 | | |
1081 | 1112 | | |
| |||
1322 | 1353 | | |
1323 | 1354 | | |
1324 | 1355 | | |
1325 | | - | |
| 1356 | + | |
1326 | 1357 | | |
1327 | 1358 | | |
1328 | 1359 | | |
| |||
1368 | 1399 | | |
1369 | 1400 | | |
1370 | 1401 | | |
1371 | | - | |
| 1402 | + | |
1372 | 1403 | | |
1373 | 1404 | | |
1374 | 1405 | | |
| |||
1435 | 1466 | | |
1436 | 1467 | | |
1437 | 1468 | | |
1438 | | - | |
| 1469 | + | |
1439 | 1470 | | |
1440 | 1471 | | |
1441 | 1472 | | |
| |||
1461 | 1492 | | |
1462 | 1493 | | |
1463 | 1494 | | |
1464 | | - | |
| 1495 | + | |
1465 | 1496 | | |
1466 | 1497 | | |
1467 | 1498 | | |
| |||
1507 | 1538 | | |
1508 | 1539 | | |
1509 | 1540 | | |
1510 | | - | |
| 1541 | + | |
1511 | 1542 | | |
1512 | 1543 | | |
1513 | 1544 | | |
| |||
0 commit comments