Commit d30b8dc
fix(pi-embedded): strip [tool calls omitted] from user-facing text (#74578)
* fix(pi-embedded): strip [tool calls omitted] from user-facing text
The internal replay placeholder '[tool calls omitted]' was leaking
into channel output (e.g. Telegram) after aborted tool calls.
Fix: strip the placeholder early in sanitizeUserFacingText so all
channels are protected by default. The replay transcript path in
turns.ts is unaffected — it uses the placeholder internally.
Fixes #74573.
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
* fix(pi-embedded): preserve whitespace when stripping placeholder
* test(pi-embedded): document replay placeholder sanitization
* fix(pi-embedded): strip consecutive replay placeholders
---------
Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>1 parent 845dd2a commit d30b8dc
3 files changed
Lines changed: 39 additions & 7 deletions
File tree
- src/agents
- pi-embedded-helpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
211 | 226 | | |
212 | 227 | | |
213 | 228 | | |
| |||
Lines changed: 23 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
335 | 352 | | |
336 | 353 | | |
337 | 354 | | |
| |||
383 | 400 | | |
384 | 401 | | |
385 | 402 | | |
386 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
387 | 408 | | |
388 | 409 | | |
389 | 410 | | |
390 | 411 | | |
391 | 412 | | |
392 | 413 | | |
393 | 414 | | |
394 | | - | |
395 | 415 | | |
396 | 416 | | |
397 | 417 | | |
| |||
422 | 442 | | |
423 | 443 | | |
424 | 444 | | |
425 | | - | |
426 | 445 | | |
427 | 446 | | |
428 | 447 | | |
429 | | - | |
430 | 448 | | |
431 | 449 | | |
432 | 450 | | |
433 | | - | |
434 | 451 | | |
435 | 452 | | |
436 | 453 | | |
437 | | - | |
438 | 454 | | |
439 | 455 | | |
440 | 456 | | |
| |||
451 | 467 | | |
452 | 468 | | |
453 | 469 | | |
454 | | - | |
| 470 | + | |
455 | 471 | | |
456 | 472 | | |
0 commit comments