Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks for the review! I checked the Windows failure: The Windows Harness suite completed with 1,240 tests, 0 failures/errors and 18 skipped; all seven pruning tests, including both new regressions, passed. The Ubuntu build also passed. Failed Windows job. Could a maintainer rerun the failed Windows job to check whether this is intermittent? I have not changed the service test's timeout based on this single failure. |
|
Checked Both controls and the seven pruning tests pass on this head. Reverting only the per-result counting line produces four failures: both added controls and your two batching regressions. After restoring the line, the related compaction/middleware/token/async-wait slice passes all 52 tests, with no failures/errors/skips. Production is restored; this is focused verification, not a full Service/Windows reactor result. The two extra tests are available in 32c71750 as a test-only commit for adoption if useful. |
Backport the verified fix to the 2.0.x implementation and retain its existing public contracts where the upstream kernel differs. (cherry picked from commit 9776a37) Backport-review-patch: da6f99255cc58a07360717e447a9a04de01091a9 Constraint: No AgentScope Service or SDK migration Confidence: high Not-tested: Whole-repository verification pending after lane integration
AgentScope-Java Version
2.1.0-SNAPSHOT, based on main c2ff087.
Description
Fixes #3537.
When a TOOL message contains several results,
pruneToolResultscounts the whole message for each result. This exhausts the recent-output protection budget too early and can trigger pruning below the configured minimum. With six 1,000-character results, batching them in one message protects fewer recent results than six separate messages; it also incorrectly exceeds a 3,000-token minimum.Count each result using a message copy containing only that block. This preserves single-result estimates without changing the token estimator or mutating the original history. Two public
compactIfNeededregressions cover the protection window and minimum threshold, and the English/Chinese context docs clarify the budget. This applies to batched/custom histories; the default ReAct tool-message builder normally emits one result per message.Validation
git diff --checkpass.npm run validatepasses (430 pages / 584 redirects and Mint build validation).GracefulShutdownTestfailure (defaultConfig: expected null, got PT0.1S); that test passed in the first run. Core source/tests are untouched. The full reactor is not claimed green.mint broken-linksreports 2,208 links in 326 files on both original HEAD docs and this patch, with identical reported paths. No new links are introduced.Commands:
AI assistance was used for source review, implementation, and tests. The reproductions were executed locally and the final diff was checked against the surrounding code and documented contract.
Checklist
mvn spotless:applymvn test) — full reactor limitations described above