PeaceMaker-best e7c059d8d4
fix(agents): prioritize loop hard stops across tool batches (#5245)
* fix(agents): prioritize loop hard stops across tool batches

Scan an admitted multi-tool response completely before selecting a soft warning, so any configured hard limit can reject the whole batch. Preserve warning priority and sliding-window accounting.

Add counter-level plus sync and async compiled-agent regressions proving rejected tools are not executed.

Fixes bytedance/deer-flow#5243. AI-assisted implementation and tests.

* fix(agents): rearm loop warnings after cross-tool eviction

When another tool evicts an older tool below its frequency warning threshold, clear the older suppression mark so a later burst can warn again.

Add the cross-tool sliding-window regression from the final boundary review. AI-assisted implementation and tests.

* test(agents): cover override-aware loop warning rearm

Cache the default frequency thresholds for sliding-window eviction and verify that an evicted tool uses its configured override when warning eligibility is rearmed.

Document that simultaneous frequency warnings preserve legacy first-crossing selection while hard stops remain batch-severity-first.

Addresses review on #5245. AI-assisted implementation and tests.

---------

Co-authored-by: PeaceMaker-best <221849497+PeaceMaker-best@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-09-07 18:31:11 +08:00
..