mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-26 04:11:13 +00:00
fix(agents): finish aggregate prompt reduction
This commit is contained in:
@@ -593,10 +593,10 @@ function buildAggregateToolResultReplacements(params: {
|
||||
if (remainingReduction <= 0) {
|
||||
break;
|
||||
}
|
||||
if (replacements.some((replacement) => replacement.entryId === candidate.entryId)) {
|
||||
continue;
|
||||
}
|
||||
const emptyMessage = clearToolResultText(candidate.message);
|
||||
const existingReplacement = replacements.find(
|
||||
(replacement) => replacement.entryId === candidate.entryId,
|
||||
);
|
||||
const emptyMessage = clearToolResultText(existingReplacement?.message ?? candidate.message);
|
||||
const actualReduction = Math.max(
|
||||
0,
|
||||
candidate.textLength - getToolResultTextLength(emptyMessage),
|
||||
|
||||
Reference in New Issue
Block a user