Commit b2dadef
committed
fix(agents): defer bootstrap context-engine maintenance to background
Bootstrap/reconcile context-engine maintenance runs foreground, where
deferred compaction debt cannot execute (allowDeferredCompactionExecution is
background-only) and no background follow-up is scheduled — only turns defer.
So debt created when bootstrap imports tail messages past the leaf trigger is
stranded, leaving sessions repeating "deferred compaction still needed"
(issue #67716, Case 1).
Extend the deferred-maintenance gate so reason="bootstrap" also schedules the
existing background debt consumer for engines that opt into background
maintenance (turnMaintenanceMode === "background"). Foreground bootstrap is
unchanged for engines without background maintenance, and the plugin-owned
hot-cache sticky-debt path (Case 2) is intentionally left out of scope.
Closes #677161 parent 8b546fa commit b2dadef
2 files changed
Lines changed: 66 additions & 1 deletion
File tree
- src/agents/embedded-agent-runner
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
677 | 738 | | |
678 | 739 | | |
679 | 740 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
714 | 718 | | |
715 | | - | |
| 719 | + | |
716 | 720 | | |
717 | 721 | | |
718 | 722 | | |
| |||
0 commit comments