Repository navigation
Commit c31638d
committed
fix(sessions): arm the max-turns terminal marker only once guardrails pass
finalize_max_turns_handler_output() drives the same save callback from its
guardrail-error path, so marking inside that callback closed the state for an
output that never passed its guardrails and never reached the caller. A failed
append there rejected every later resume, which is worse than the replay the
marker exists to prevent: the run had nothing to protect and no way forward.
Arm and clear at the success call site instead, which is only reachable once the
handler output cleared its guardrails and ran its end hooks. That matches the
streamed finalizer, which already wraps only its post-guardrail save, so both
runners now arm on the same condition.1 parent 4847f9d commit c31638d
2 files changed
Lines changed: 51 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1526 | 1526 | | |
1527 | 1527 | | |
1528 | 1528 | | |
1529 | | - | |
1530 | 1529 | | |
1531 | 1530 | | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | 1531 | | |
1539 | 1532 | | |
1540 | 1533 | | |
| |||
1548 | 1541 | | |
1549 | 1542 | | |
1550 | 1543 | | |
1551 | | - | |
1552 | | - | |
1553 | 1544 | | |
1554 | 1545 | | |
1555 | 1546 | | |
| |||
1570 | 1561 | | |
1571 | 1562 | | |
1572 | 1563 | | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
1573 | 1571 | | |
| 1572 | + | |
| 1573 | + | |
1574 | 1574 | | |
1575 | 1575 | | |
1576 | 1576 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
1454 | 1454 | | |
1455 | 1455 | | |
1456 | 1456 | | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
0 commit comments