Commit a1f0cdb
EC2 Default User
fix: prevent interrupt mode from replaying previous assistant reply
When messages.queue.mode is 'interrupt', aborting an active run causes
the previous turn's assistant reply to be re-sent to the user.
Root cause: buildEmbeddedRunPayloads falls back to
extractAssistantText(lastAssistant) when assistantTexts is empty.
After an abort, assistantTexts is empty but lastAssistant still
references the previous turn's message from session history.
Fix:
1. Guard lastAssistant fallback: pass undefined when aborted and no
new assistant text was generated (run.ts)
2. Skip blockReplyPipeline flush and payload delivery entirely when
the run was aborted (agent-runner.ts)
Fixes #501451 parent ffc1d54 commit a1f0cdb
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1605 | 1605 | | |
1606 | 1606 | | |
1607 | 1607 | | |
1608 | | - | |
| 1608 | + | |
| 1609 | + | |
1609 | 1610 | | |
1610 | 1611 | | |
1611 | 1612 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
409 | 410 | | |
410 | 411 | | |
411 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
412 | 417 | | |
413 | 418 | | |
414 | 419 | | |
| |||
478 | 483 | | |
479 | 484 | | |
480 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
481 | 493 | | |
482 | 494 | | |
483 | 495 | | |
| |||
0 commit comments