Repository navigation
Commit 6637747
committed
fix(codex): preserve assistant text on post-turn compaction failure (#94688)
When the Codex app-server marks a turn as 'failed' because post-turn
CLI transcript compaction summarization failed (e.g. Connection error),
the bounded-turn collector now recovers the already-collected assistant
text from item/agentMessage/delta and item/completed notifications
instead of discarding it.
Root cause: text collection happened AFTER error checks, so a
'failed' status always threw before inspecting the accumulated
assistantTextByItem map.
Fix: collect text and items first, then only throw when the turn
is genuinely empty. Compaction failures are still logged at warn
level for observability.1 parent f7c3775 commit 6637747
1 file changed
Lines changed: 27 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
404 | 405 | | |
405 | 406 | | |
406 | 407 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
415 | 412 | | |
416 | 413 | | |
417 | 414 | | |
| |||
420 | 417 | | |
421 | 418 | | |
422 | 419 | | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
423 | 442 | | |
424 | 443 | | |
425 | 444 | | |
| |||
0 commit comments