Repository navigation
Commit 8cc647d
incomplete-turn: don't surface 'couldn't generate' for silent replies
Follow-on to PR #69472 (auto-reply silent-reply suppressor for reasoning-
prefaced sentinels like "think\n...\nNO_REPLY"). The outbound suppressor
correctly stripped these from delivery, but the runner's incomplete-turn
classifier and three retry resolvers (planning-only / reasoning-only /
empty-response) saw payloadCount=0 + assistantTexts=[] and re-prompted
the model on every spam decision. Each retry burned LLM tokens and the
final classifier surfaced a "Agent couldn't generate a response" warning
to the channel even though the original silence was intentional.
Three minimal call-site changes in src/agents/pi-embedded-runner/run/
incomplete-turn.ts:
- hasOnlySilentAssistantReply now also reads lastAssistant.content text
parts (assistantTexts can be empty when streaming/chunker filters drop
the assistant text before the run wrapper records it).
- isReasoningOnlyAssistantTurn returns false when the message text is a
silent reply payload — silent NO_REPLY is intentional silence, not an
unfinished reasoning turn that should be retried.
- isEmptyResponseAssistantTurn returns false for the same reason — gates
the empty-response retry resolver against firing on intentional silence.
Regression test in run.incomplete-turn.test.ts uses the exact Discord
session payload that triggered this on April 24 and 27.
Closes #69470 (follow-on)1 parent 6388f29 commit 8cc647d
2 files changed
Lines changed: 103 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
81 | 124 | | |
82 | 125 | | |
83 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
283 | 286 | | |
284 | | - | |
285 | | - | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
289 | 326 | | |
290 | 327 | | |
291 | 328 | | |
| |||
402 | 439 | | |
403 | 440 | | |
404 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
405 | 453 | | |
406 | 454 | | |
407 | 455 | | |
| |||
425 | 473 | | |
426 | 474 | | |
427 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
428 | 483 | | |
429 | 484 | | |
430 | 485 | | |
| |||
0 commit comments