@librechat/agents 3.1.60 → 3.1.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@librechat/agents",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.61",
|
|
4
4
|
"main": "./dist/cjs/main.cjs",
|
|
5
5
|
"module": "./dist/esm/main.mjs",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -112,13 +112,13 @@
|
|
|
112
112
|
"@browserbasehq/stagehand": {
|
|
113
113
|
"openai": "$openai"
|
|
114
114
|
},
|
|
115
|
-
"fast-xml-parser": "5.5.
|
|
115
|
+
"fast-xml-parser": "5.5.7",
|
|
116
116
|
"ajv": "6.14.0",
|
|
117
117
|
"minimatch": "3.1.4"
|
|
118
118
|
},
|
|
119
119
|
"dependencies": {
|
|
120
120
|
"@anthropic-ai/sdk": "^0.73.0",
|
|
121
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
121
|
+
"@aws-sdk/client-bedrock-runtime": "^3.1013.0",
|
|
122
122
|
"@langchain/anthropic": "^0.3.26",
|
|
123
123
|
"@langchain/aws": "^0.1.15",
|
|
124
124
|
"@langchain/core": "^0.3.80",
|
|
@@ -442,7 +442,7 @@ const hasAnthropic = process.env.ANTHROPIC_API_KEY != null;
|
|
|
442
442
|
(c) => (c[0] as t.SummarizeStartEvent).agentId === startPayload.agentId
|
|
443
443
|
);
|
|
444
444
|
expect(startCallsForSameAgent.length).toBeGreaterThanOrEqual(1);
|
|
445
|
-
});
|
|
445
|
+
}, 180_000);
|
|
446
446
|
|
|
447
447
|
test('post-summary continuation over multiple turns preserves context', async () => {
|
|
448
448
|
const spies = createSpies();
|
|
@@ -681,6 +681,24 @@ const hasAnthropic = process.env.ANTHROPIC_API_KEY != null;
|
|
|
681
681
|
);
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
+
if (spies.onSummarizeStartSpy.mock.calls.length === 0) {
|
|
685
|
+
run = await createRun(3000);
|
|
686
|
+
await runTurn(
|
|
687
|
+
{ run, conversationHistory },
|
|
688
|
+
'Compute 11 * 13 with calculator.',
|
|
689
|
+
streamConfig
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (spies.onSummarizeStartSpy.mock.calls.length === 0) {
|
|
694
|
+
run = await createRun(2800);
|
|
695
|
+
await runTurn(
|
|
696
|
+
{ run, conversationHistory },
|
|
697
|
+
'What is 9 * 9? Calculator.',
|
|
698
|
+
streamConfig
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
|
|
684
702
|
console.log(
|
|
685
703
|
` Cross-provider summaries: ${spies.onSummarizeCompleteSpy.mock.calls.length}`
|
|
686
704
|
);
|
|
@@ -708,7 +726,7 @@ const hasAnthropic = process.env.ANTHROPIC_API_KEY != null;
|
|
|
708
726
|
console.log(
|
|
709
727
|
` Cross-provider summary (${getSummaryText(completePayload.summary).length} chars): "${getSummaryText(completePayload.summary).substring(0, 200)}…"`
|
|
710
728
|
);
|
|
711
|
-
});
|
|
729
|
+
}, 180_000);
|
|
712
730
|
|
|
713
731
|
test('extended thinking: multi-turn with reasoning triggers summarization and grounds token accounting', async () => {
|
|
714
732
|
const spies = createSpies();
|
|
@@ -965,7 +983,7 @@ const hasAnthropic = process.env.ANTHROPIC_API_KEY != null;
|
|
|
965
983
|
expect(anthropicTokens).toBeGreaterThan(0);
|
|
966
984
|
expect(localTotal).toBeGreaterThan(0);
|
|
967
985
|
expect(driftPct).toBeLessThan(30);
|
|
968
|
-
});
|
|
986
|
+
}, 180_000);
|
|
969
987
|
});
|
|
970
988
|
|
|
971
989
|
// ---------------------------------------------------------------------------
|
|
@@ -1103,7 +1121,7 @@ const hasBedrock = requiredBedrockEnv.every((k) => process.env[k] != null);
|
|
|
1103
1121
|
);
|
|
1104
1122
|
expect(postSumResult).toBeDefined();
|
|
1105
1123
|
logTurn('Post-sum', conversationHistory);
|
|
1106
|
-
});
|
|
1124
|
+
}, 180_000);
|
|
1107
1125
|
});
|
|
1108
1126
|
|
|
1109
1127
|
// ---------------------------------------------------------------------------
|
|
@@ -1270,7 +1288,7 @@ const hasOpenAI = process.env.OPENAI_API_KEY != null;
|
|
|
1270
1288
|
` OpenAI summary: "${getSummaryText(completePayload.summary).substring(0, 200)}…"`
|
|
1271
1289
|
);
|
|
1272
1290
|
console.log(` Final messages: ${conversationHistory.length}`);
|
|
1273
|
-
});
|
|
1291
|
+
}, 120_000);
|
|
1274
1292
|
});
|
|
1275
1293
|
|
|
1276
1294
|
// ---------------------------------------------------------------------------
|
|
@@ -2495,7 +2513,7 @@ const hasAnyApiKey =
|
|
|
2495
2513
|
` Token audit: summary=${completePayload.summary!.tokenCount} tokens, ` +
|
|
2496
2514
|
`usageEntries=${validUsage.length}`
|
|
2497
2515
|
);
|
|
2498
|
-
});
|
|
2516
|
+
}, 180_000);
|
|
2499
2517
|
|
|
2500
2518
|
test('summary tokenCount matches local token counter', async () => {
|
|
2501
2519
|
const spies = createSpies();
|
|
@@ -2600,10 +2618,9 @@ const hasAnyApiKey =
|
|
|
2600
2618
|
const variance =
|
|
2601
2619
|
Math.abs(reportedTokenCount - localTokenCount) / localTokenCount;
|
|
2602
2620
|
expect(variance).toBeLessThan(0.25);
|
|
2603
|
-
});
|
|
2621
|
+
}, 180_000);
|
|
2604
2622
|
|
|
2605
2623
|
test('collectedUsage input_tokens decreases after summarization', async () => {
|
|
2606
|
-
jest.setTimeout(120_000);
|
|
2607
2624
|
const spies = createSpies();
|
|
2608
2625
|
let collectedUsage: UsageMetadata[] = [];
|
|
2609
2626
|
const conversationHistory: BaseMessage[] = [];
|
|
@@ -2731,7 +2748,7 @@ const hasAnyApiKey =
|
|
|
2731
2748
|
` Summarization fired: ${spies.onSummarizeCompleteSpy.mock.calls.length} times`
|
|
2732
2749
|
);
|
|
2733
2750
|
}
|
|
2734
|
-
});
|
|
2751
|
+
}, 180_000);
|
|
2735
2752
|
});
|
|
2736
2753
|
|
|
2737
2754
|
// ---------------------------------------------------------------------------
|