Commit bc5a7d9
committed
fix(auto-reply): sanitize stranded-reply retry prompt text (#85714)
The stranded-reply recovery retry embedded the raw private final text
into a synthetic prompt asking the agent to redeliver via
message(action=send). The message tool sanitizes runtime/inbound
metadata but not reply directives, so directive tokens
([[reply_to:...]], [[audio_as_voice]], MEDIA: lines) in the final could
survive the retry and be re-sent unsanitized, breaking the
message_tool_only privacy/directive boundary.
Run the same normalization the normal final-delivery path applies
(normalizeReplyPayloadDirectives) on the final text before quoting it in
the retry prompt, so the retry replays only the normalized visible text.
Add regression coverage: a directive-laden final has its directives
stripped from the retry prompt while the visible message survives and
the recovery guard flags persist; a directive-free final is quoted
unchanged.1 parent 746101a commit bc5a7d9
2 files changed
Lines changed: 52 additions & 1 deletion
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3579 | 3579 | | |
3580 | 3580 | | |
3581 | 3581 | | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
3582 | 3621 | | |
3583 | 3622 | | |
3584 | 3623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
2614 | 2615 | | |
2615 | 2616 | | |
2616 | 2617 | | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
2617 | 2629 | | |
2618 | 2630 | | |
2619 | 2631 | | |
2620 | 2632 | | |
2621 | 2633 | | |
2622 | | - | |
| 2634 | + | |
2623 | 2635 | | |
2624 | 2636 | | |
2625 | 2637 | | |
| |||
0 commit comments