@librechat/agents 3.1.51 → 3.1.52
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/dist/cjs/graphs/Graph.cjs +43 -16
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/run.cjs +32 -2
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/utils/run.cjs +3 -1
- package/dist/cjs/utils/run.cjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +43 -16
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/run.mjs +32 -2
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/utils/run.mjs +3 -1
- package/dist/esm/utils/run.mjs.map +1 -1
- package/dist/types/graphs/Graph.d.ts +7 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/types/run.d.ts +2 -0
- package/package.json +1 -1
- package/src/graphs/Graph.ts +49 -20
- package/src/run.ts +40 -2
- package/src/scripts/ant_web_search.ts +1 -0
- package/src/scripts/ant_web_search_edge_case.ts +1 -0
- package/src/scripts/ant_web_search_error_edge_case.ts +1 -0
- package/src/scripts/bedrock-content-aggregation-test.ts +1 -0
- package/src/scripts/bedrock-parallel-tools-test.ts +1 -0
- package/src/scripts/caching.ts +1 -0
- package/src/scripts/code_exec.ts +1 -0
- package/src/scripts/code_exec_files.ts +1 -0
- package/src/scripts/code_exec_multi_session.ts +1 -0
- package/src/scripts/code_exec_ptc.ts +1 -0
- package/src/scripts/code_exec_session.ts +1 -0
- package/src/scripts/code_exec_simple.ts +1 -0
- package/src/scripts/content.ts +1 -0
- package/src/scripts/image.ts +1 -0
- package/src/scripts/memory.ts +16 -6
- package/src/scripts/multi-agent-chain.ts +1 -0
- package/src/scripts/multi-agent-conditional.ts +1 -0
- package/src/scripts/multi-agent-document-review-chain.ts +1 -0
- package/src/scripts/multi-agent-hybrid-flow.ts +1 -0
- package/src/scripts/multi-agent-parallel-start.ts +1 -0
- package/src/scripts/multi-agent-parallel.ts +1 -0
- package/src/scripts/multi-agent-sequence.ts +1 -0
- package/src/scripts/multi-agent-supervisor.ts +1 -0
- package/src/scripts/multi-agent-test.ts +1 -0
- package/src/scripts/parallel-asymmetric-tools-test.ts +1 -0
- package/src/scripts/parallel-full-metadata-test.ts +1 -0
- package/src/scripts/parallel-tools-test.ts +1 -0
- package/src/scripts/programmatic_exec_agent.ts +1 -0
- package/src/scripts/search.ts +1 -0
- package/src/scripts/sequential-full-metadata-test.ts +1 -0
- package/src/scripts/simple.ts +1 -0
- package/src/scripts/single-agent-metadata-test.ts +1 -0
- package/src/scripts/stream.ts +1 -0
- package/src/scripts/test-handoff-preamble.ts +1 -0
- package/src/scripts/test-handoff-steering.ts +3 -0
- package/src/scripts/test-multi-agent-list-handoff.ts +1 -0
- package/src/scripts/test-parallel-agent-labeling.ts +2 -0
- package/src/scripts/test-parallel-handoffs.ts +1 -0
- package/src/scripts/test-thinking-handoff-bedrock.ts +1 -0
- package/src/scripts/test-thinking-handoff.ts +1 -0
- package/src/scripts/test-thinking-to-thinking-handoff-bedrock.ts +1 -0
- package/src/scripts/test-tool-before-handoff-role-order.ts +1 -0
- package/src/scripts/test-tools-before-handoff.ts +1 -0
- package/src/scripts/thinking-bedrock.ts +1 -0
- package/src/scripts/thinking.ts +1 -0
- package/src/scripts/tools.ts +1 -0
- package/src/specs/agent-handoffs.test.ts +1 -0
- package/src/specs/anthropic.simple.test.ts +4 -0
- package/src/specs/azure.simple.test.ts +142 -3
- package/src/specs/cache.simple.test.ts +8 -0
- package/src/specs/custom-event-await.test.ts +2 -0
- package/src/specs/deepseek.simple.test.ts +3 -0
- package/src/specs/moonshot.simple.test.ts +5 -0
- package/src/specs/openai.simple.test.ts +3 -0
- package/src/specs/openrouter.simple.test.ts +1 -0
- package/src/specs/prune.test.ts +1 -0
- package/src/specs/reasoning.test.ts +1 -0
- package/src/specs/thinking-handoff.test.ts +1 -0
- package/src/specs/tool-error.test.ts +1 -0
- package/src/types/run.ts +2 -0
- package/src/utils/run.ts +4 -2
package/src/scripts/search.ts
CHANGED
package/src/scripts/simple.ts
CHANGED
package/src/scripts/stream.ts
CHANGED
|
@@ -134,6 +134,7 @@ When you receive a task, execute it thoroughly. Always identify yourself as the
|
|
|
134
134
|
graphConfig: { type: 'multi-agent', agents, edges },
|
|
135
135
|
customHandlers,
|
|
136
136
|
returnContent: true,
|
|
137
|
+
skipCleanup: true,
|
|
137
138
|
});
|
|
138
139
|
|
|
139
140
|
const streamConfig: Partial<RunnableConfig> & {
|
|
@@ -238,6 +239,7 @@ You must follow the exact format requested.`,
|
|
|
238
239
|
graphConfig: { type: 'multi-agent', agents, edges },
|
|
239
240
|
customHandlers,
|
|
240
241
|
returnContent: true,
|
|
242
|
+
skipCleanup: true,
|
|
241
243
|
});
|
|
242
244
|
|
|
243
245
|
const streamConfig: Partial<RunnableConfig> & {
|
|
@@ -332,6 +334,7 @@ If asked about non-Italian food, politely redirect to Italian alternatives.`,
|
|
|
332
334
|
graphConfig: { type: 'multi-agent', agents, edges },
|
|
333
335
|
customHandlers,
|
|
334
336
|
returnContent: true,
|
|
337
|
+
skipCleanup: true,
|
|
335
338
|
});
|
|
336
339
|
|
|
337
340
|
const streamConfig: Partial<RunnableConfig> & {
|
|
@@ -150,6 +150,7 @@ async function testParallelWithAgentLabeling() {
|
|
|
150
150
|
},
|
|
151
151
|
customHandlers,
|
|
152
152
|
returnContent: true,
|
|
153
|
+
skipCleanup: true,
|
|
153
154
|
};
|
|
154
155
|
|
|
155
156
|
const run = await Run.create(runConfig);
|
|
@@ -291,6 +292,7 @@ async function testParallelWithAgentLabeling() {
|
|
|
291
292
|
},
|
|
292
293
|
customHandlers,
|
|
293
294
|
returnContent: true,
|
|
295
|
+
skipCleanup: true,
|
|
294
296
|
};
|
|
295
297
|
|
|
296
298
|
const run2 = await Run.create(runConfig2);
|
package/src/scripts/thinking.ts
CHANGED
package/src/scripts/tools.ts
CHANGED
|
@@ -131,6 +131,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
131
131
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
132
132
|
},
|
|
133
133
|
returnContent: true,
|
|
134
|
+
skipCleanup: true,
|
|
134
135
|
customHandlers,
|
|
135
136
|
});
|
|
136
137
|
|
|
@@ -206,6 +207,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
206
207
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
207
208
|
},
|
|
208
209
|
returnContent: true,
|
|
210
|
+
skipCleanup: true,
|
|
209
211
|
customHandlers,
|
|
210
212
|
});
|
|
211
213
|
|
|
@@ -270,6 +272,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
270
272
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
271
273
|
},
|
|
272
274
|
returnContent: true,
|
|
275
|
+
skipCleanup: true,
|
|
273
276
|
customHandlers,
|
|
274
277
|
});
|
|
275
278
|
|
|
@@ -325,6 +328,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
325
328
|
instructions: 'You are a helpful AI assistant.',
|
|
326
329
|
},
|
|
327
330
|
returnContent: true,
|
|
331
|
+
skipCleanup: true,
|
|
328
332
|
customHandlers,
|
|
329
333
|
});
|
|
330
334
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
// src/
|
|
3
|
+
// src/specs/azure.simple.test.ts
|
|
4
4
|
import { config } from 'dotenv';
|
|
5
5
|
config();
|
|
6
6
|
import { Calculator } from '@/tools/Calculator';
|
|
@@ -21,7 +21,6 @@ import { createContentAggregator } from '@/stream';
|
|
|
21
21
|
import { getLLMConfig } from '@/utils/llmConfig';
|
|
22
22
|
import { Run } from '@/run';
|
|
23
23
|
|
|
24
|
-
// Auto-skip this suite if Azure env vars are not present
|
|
25
24
|
const requiredAzureEnv = [
|
|
26
25
|
'AZURE_OPENAI_API_KEY',
|
|
27
26
|
'AZURE_OPENAI_API_INSTANCE',
|
|
@@ -150,6 +149,7 @@ describeIfAzure(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
150
149
|
'You are a helpful AI assistant. Keep responses concise and friendly.',
|
|
151
150
|
},
|
|
152
151
|
returnContent: true,
|
|
152
|
+
skipCleanup: true,
|
|
153
153
|
customHandlers,
|
|
154
154
|
});
|
|
155
155
|
|
|
@@ -235,6 +235,7 @@ describeIfAzure(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
235
235
|
'You are a helpful AI assistant. Keep responses concise and friendly.',
|
|
236
236
|
},
|
|
237
237
|
returnContent: true,
|
|
238
|
+
skipCleanup: true,
|
|
238
239
|
customHandlers,
|
|
239
240
|
});
|
|
240
241
|
|
|
@@ -307,6 +308,7 @@ describeIfAzure(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
307
308
|
'You are a helpful AI assistant. Keep responses concise and friendly.',
|
|
308
309
|
},
|
|
309
310
|
returnContent: true,
|
|
311
|
+
skipCleanup: true,
|
|
310
312
|
customHandlers,
|
|
311
313
|
});
|
|
312
314
|
|
|
@@ -349,8 +351,145 @@ describeIfAzure(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
349
351
|
}
|
|
350
352
|
});
|
|
351
353
|
|
|
354
|
+
test(`${capitalizeFirstLetter(provider)}: disableStreaming should not duplicate message content`, async () => {
|
|
355
|
+
if (contentFilterTriggered) {
|
|
356
|
+
console.warn(
|
|
357
|
+
'Skipping test: Azure content filter was triggered in previous test'
|
|
358
|
+
);
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
try {
|
|
362
|
+
const llmConfig = getLLMConfig(provider);
|
|
363
|
+
const nonStreamingConfig: t.LLMConfig = {
|
|
364
|
+
...llmConfig,
|
|
365
|
+
disableStreaming: true,
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const messageDeltaPayloads: t.MessageDeltaEvent[] = [];
|
|
369
|
+
const localRunStepSpy = jest.fn();
|
|
370
|
+
const localAggregateContent = createContentAggregator();
|
|
371
|
+
const localContentParts =
|
|
372
|
+
localAggregateContent.contentParts as t.MessageContentComplex[];
|
|
373
|
+
const localAggregate = localAggregateContent.aggregateContent;
|
|
374
|
+
|
|
375
|
+
const customHandlers: Record<string | GraphEvents, t.EventHandler> = {
|
|
376
|
+
[GraphEvents.TOOL_END]: new ToolEndHandler(),
|
|
377
|
+
[GraphEvents.CHAT_MODEL_END]: new ModelEndHandler(collectedUsage),
|
|
378
|
+
[GraphEvents.ON_RUN_STEP_COMPLETED]: {
|
|
379
|
+
handle: (
|
|
380
|
+
event: GraphEvents.ON_RUN_STEP_COMPLETED,
|
|
381
|
+
data: t.StreamEventData
|
|
382
|
+
): void => {
|
|
383
|
+
localAggregate({
|
|
384
|
+
event,
|
|
385
|
+
data: data as unknown as { result: t.ToolEndEvent },
|
|
386
|
+
});
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
[GraphEvents.ON_RUN_STEP]: {
|
|
390
|
+
handle: (
|
|
391
|
+
event: GraphEvents.ON_RUN_STEP,
|
|
392
|
+
data: t.StreamEventData,
|
|
393
|
+
metadata,
|
|
394
|
+
graph
|
|
395
|
+
): void => {
|
|
396
|
+
localRunStepSpy(event, data, metadata, graph);
|
|
397
|
+
localAggregate({ event, data: data as t.RunStep });
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
[GraphEvents.ON_RUN_STEP_DELTA]: {
|
|
401
|
+
handle: (
|
|
402
|
+
event: GraphEvents.ON_RUN_STEP_DELTA,
|
|
403
|
+
data: t.StreamEventData
|
|
404
|
+
): void => {
|
|
405
|
+
localAggregate({ event, data: data as t.RunStepDeltaEvent });
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
[GraphEvents.ON_MESSAGE_DELTA]: {
|
|
409
|
+
handle: (
|
|
410
|
+
event: GraphEvents.ON_MESSAGE_DELTA,
|
|
411
|
+
data: t.StreamEventData
|
|
412
|
+
): void => {
|
|
413
|
+
messageDeltaPayloads.push(data as t.MessageDeltaEvent);
|
|
414
|
+
localAggregate({ event, data: data as t.MessageDeltaEvent });
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
run = await Run.create<t.IState>({
|
|
420
|
+
runId: 'azure-disable-streaming-dedup-test',
|
|
421
|
+
graphConfig: {
|
|
422
|
+
type: 'standard',
|
|
423
|
+
llmConfig: nonStreamingConfig,
|
|
424
|
+
tools: [],
|
|
425
|
+
instructions:
|
|
426
|
+
'You are a helpful AI assistant. Respond with exactly one sentence.',
|
|
427
|
+
},
|
|
428
|
+
returnContent: true,
|
|
429
|
+
skipCleanup: true,
|
|
430
|
+
customHandlers,
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
conversationHistory.push(new HumanMessage('Hello'));
|
|
434
|
+
|
|
435
|
+
const finalContentParts = await run.processStream(
|
|
436
|
+
{ messages: conversationHistory },
|
|
437
|
+
config
|
|
438
|
+
);
|
|
439
|
+
|
|
440
|
+
expect(finalContentParts).toBeDefined();
|
|
441
|
+
expect(finalContentParts!.length).toBeGreaterThan(0);
|
|
442
|
+
expect(messageDeltaPayloads.length).toBeGreaterThan(0);
|
|
443
|
+
|
|
444
|
+
const allTextDeltas = messageDeltaPayloads
|
|
445
|
+
.flatMap((p) => p.delta.content ?? [])
|
|
446
|
+
.filter((c) => c.type === ContentTypes.TEXT)
|
|
447
|
+
.map((c) => ('text' in c ? c.text : ''));
|
|
448
|
+
|
|
449
|
+
const combinedText = allTextDeltas.join('');
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* When model.stream() is available (the common path even with
|
|
453
|
+
* disableStreaming), ChatModelStreamHandler already dispatches the full
|
|
454
|
+
* text as a single MESSAGE_DELTA. The disableStreaming fallback block in
|
|
455
|
+
* createCallModel must NOT dispatch the same content a second time.
|
|
456
|
+
*
|
|
457
|
+
* If the bug is present, the text is emitted twice and localContentParts
|
|
458
|
+
* will contain duplicated text.
|
|
459
|
+
*/
|
|
460
|
+
const aggregatedText = localContentParts
|
|
461
|
+
.filter((p) => p.type === ContentTypes.TEXT)
|
|
462
|
+
.map((p) => ('text' in p ? p.text : ''))
|
|
463
|
+
.join('');
|
|
464
|
+
|
|
465
|
+
console.log('Message delta count:', messageDeltaPayloads.length);
|
|
466
|
+
console.log('Combined delta text length:', combinedText.length);
|
|
467
|
+
console.log('Aggregated text length:', aggregatedText.length);
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Each delta payload contains the FULL text (non-streaming returns a
|
|
471
|
+
* single chunk). If the bug is present, we get >=2 identical payloads
|
|
472
|
+
* and the aggregated text will be 2x the actual response.
|
|
473
|
+
*/
|
|
474
|
+
const uniqueTexts = [...new Set(allTextDeltas)];
|
|
475
|
+
expect(uniqueTexts.length).toBe(1);
|
|
476
|
+
expect(uniqueTexts[0].length).toBeGreaterThan(0);
|
|
477
|
+
|
|
478
|
+
const singleResponseText = uniqueTexts[0];
|
|
479
|
+
expect(aggregatedText).toBe(singleResponseText);
|
|
480
|
+
expect(combinedText).toBe(singleResponseText);
|
|
481
|
+
|
|
482
|
+
console.log('disableStreaming dedup test passed — no duplicate content');
|
|
483
|
+
} catch (error) {
|
|
484
|
+
if (isContentFilterError(error)) {
|
|
485
|
+
console.warn('Skipping test: Azure content filter triggered');
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
throw error;
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
|
|
352
492
|
test('should handle errors appropriately', async () => {
|
|
353
|
-
// Test error scenarios
|
|
354
493
|
await expect(async () => {
|
|
355
494
|
await run.processStream(
|
|
356
495
|
{
|
|
@@ -100,6 +100,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
100
100
|
additional_instructions: `User: ${userName}, Location: ${location}`,
|
|
101
101
|
},
|
|
102
102
|
returnContent: true,
|
|
103
|
+
skipCleanup: true,
|
|
103
104
|
customHandlers,
|
|
104
105
|
});
|
|
105
106
|
|
|
@@ -145,6 +146,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
145
146
|
additional_instructions: `User: ${userName}, Location: ${location}`,
|
|
146
147
|
},
|
|
147
148
|
returnContent: true,
|
|
149
|
+
skipCleanup: true,
|
|
148
150
|
customHandlers,
|
|
149
151
|
});
|
|
150
152
|
|
|
@@ -182,6 +184,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
182
184
|
'You are a math assistant. Use the calculator tool for all calculations.',
|
|
183
185
|
},
|
|
184
186
|
returnContent: true,
|
|
187
|
+
skipCleanup: true,
|
|
185
188
|
customHandlers,
|
|
186
189
|
});
|
|
187
190
|
|
|
@@ -227,6 +230,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
227
230
|
additional_instructions: `User: ${userName}, Location: ${location}`,
|
|
228
231
|
},
|
|
229
232
|
returnContent: true,
|
|
233
|
+
skipCleanup: true,
|
|
230
234
|
customHandlers,
|
|
231
235
|
});
|
|
232
236
|
|
|
@@ -271,6 +275,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
271
275
|
additional_instructions: `User: ${userName}, Location: ${location}`,
|
|
272
276
|
},
|
|
273
277
|
returnContent: true,
|
|
278
|
+
skipCleanup: true,
|
|
274
279
|
customHandlers,
|
|
275
280
|
});
|
|
276
281
|
|
|
@@ -307,6 +312,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
307
312
|
'You are a math assistant. Use the calculator tool for all calculations.',
|
|
308
313
|
},
|
|
309
314
|
returnContent: true,
|
|
315
|
+
skipCleanup: true,
|
|
310
316
|
customHandlers,
|
|
311
317
|
});
|
|
312
318
|
|
|
@@ -356,6 +362,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
356
362
|
instructions: 'You are a helpful assistant.',
|
|
357
363
|
},
|
|
358
364
|
returnContent: true,
|
|
365
|
+
skipCleanup: true,
|
|
359
366
|
customHandlers: handlers1,
|
|
360
367
|
});
|
|
361
368
|
|
|
@@ -377,6 +384,7 @@ describe('Prompt Caching Integration Tests', () => {
|
|
|
377
384
|
instructions: 'You are a helpful assistant.',
|
|
378
385
|
},
|
|
379
386
|
returnContent: true,
|
|
387
|
+
skipCleanup: true,
|
|
380
388
|
customHandlers: handlers2,
|
|
381
389
|
});
|
|
382
390
|
|
|
@@ -89,6 +89,7 @@ describe('Custom event handler awaitHandlers behavior', () => {
|
|
|
89
89
|
llmConfig,
|
|
90
90
|
},
|
|
91
91
|
returnContent: true,
|
|
92
|
+
skipCleanup: true,
|
|
92
93
|
customHandlers,
|
|
93
94
|
});
|
|
94
95
|
|
|
@@ -183,6 +184,7 @@ describe('Custom event handler awaitHandlers behavior', () => {
|
|
|
183
184
|
llmConfig,
|
|
184
185
|
},
|
|
185
186
|
returnContent: true,
|
|
187
|
+
skipCleanup: true,
|
|
186
188
|
customHandlers,
|
|
187
189
|
});
|
|
188
190
|
|
|
@@ -137,6 +137,7 @@ const skipTests = process.env.DEEPSEEK_API_KEY == null;
|
|
|
137
137
|
'You are a helpful math assistant. Use the calculator tool to solve math problems.',
|
|
138
138
|
},
|
|
139
139
|
returnContent: true,
|
|
140
|
+
skipCleanup: true,
|
|
140
141
|
customHandlers,
|
|
141
142
|
});
|
|
142
143
|
|
|
@@ -197,6 +198,7 @@ const skipTests = process.env.DEEPSEEK_API_KEY == null;
|
|
|
197
198
|
'You are a helpful math assistant. Use the calculator tool to solve math problems.',
|
|
198
199
|
},
|
|
199
200
|
returnContent: true,
|
|
201
|
+
skipCleanup: true,
|
|
200
202
|
customHandlers,
|
|
201
203
|
});
|
|
202
204
|
|
|
@@ -249,6 +251,7 @@ const skipTests = process.env.DEEPSEEK_API_KEY == null;
|
|
|
249
251
|
instructions: 'You are a friendly AI assistant.',
|
|
250
252
|
},
|
|
251
253
|
returnContent: true,
|
|
254
|
+
skipCleanup: true,
|
|
252
255
|
customHandlers,
|
|
253
256
|
});
|
|
254
257
|
|
|
@@ -144,6 +144,7 @@ const skipTests = process.env.MOONSHOT_API_KEY == null;
|
|
|
144
144
|
'You are a helpful math assistant. Use the calculator tool to solve math problems.',
|
|
145
145
|
},
|
|
146
146
|
returnContent: true,
|
|
147
|
+
skipCleanup: true,
|
|
147
148
|
customHandlers,
|
|
148
149
|
});
|
|
149
150
|
|
|
@@ -197,6 +198,7 @@ const skipTests = process.env.MOONSHOT_API_KEY == null;
|
|
|
197
198
|
'You are a helpful math assistant. Use the calculator tool when needed.',
|
|
198
199
|
},
|
|
199
200
|
returnContent: true,
|
|
201
|
+
skipCleanup: true,
|
|
200
202
|
customHandlers,
|
|
201
203
|
});
|
|
202
204
|
|
|
@@ -230,6 +232,7 @@ const skipTests = process.env.MOONSHOT_API_KEY == null;
|
|
|
230
232
|
'You are a helpful math assistant. Use the calculator tool when needed.',
|
|
231
233
|
},
|
|
232
234
|
returnContent: true,
|
|
235
|
+
skipCleanup: true,
|
|
233
236
|
customHandlers,
|
|
234
237
|
});
|
|
235
238
|
|
|
@@ -266,6 +269,7 @@ const skipTests = process.env.MOONSHOT_API_KEY == null;
|
|
|
266
269
|
instructions: 'You are a friendly AI assistant.',
|
|
267
270
|
},
|
|
268
271
|
returnContent: true,
|
|
272
|
+
skipCleanup: true,
|
|
269
273
|
customHandlers,
|
|
270
274
|
});
|
|
271
275
|
|
|
@@ -314,6 +318,7 @@ const skipTests = process.env.MOONSHOT_API_KEY == null;
|
|
|
314
318
|
'You are a helpful math assistant. Use the calculator tool to solve math problems.',
|
|
315
319
|
},
|
|
316
320
|
returnContent: true,
|
|
321
|
+
skipCleanup: true,
|
|
317
322
|
customHandlers,
|
|
318
323
|
});
|
|
319
324
|
|
|
@@ -131,6 +131,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
131
131
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
132
132
|
},
|
|
133
133
|
returnContent: true,
|
|
134
|
+
skipCleanup: true,
|
|
134
135
|
customHandlers,
|
|
135
136
|
});
|
|
136
137
|
|
|
@@ -202,6 +203,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
202
203
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
203
204
|
},
|
|
204
205
|
returnContent: true,
|
|
206
|
+
skipCleanup: true,
|
|
205
207
|
customHandlers,
|
|
206
208
|
});
|
|
207
209
|
|
|
@@ -261,6 +263,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
261
263
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
262
264
|
},
|
|
263
265
|
returnContent: true,
|
|
266
|
+
skipCleanup: true,
|
|
264
267
|
customHandlers,
|
|
265
268
|
});
|
|
266
269
|
|
package/src/specs/prune.test.ts
CHANGED
|
@@ -158,6 +158,7 @@ describe(`${capitalizeFirstLetter(provider)} Streaming Tests`, () => {
|
|
|
158
158
|
additional_instructions: `The user's name is ${userName} and they are located in ${location}.`,
|
|
159
159
|
},
|
|
160
160
|
returnContent: true,
|
|
161
|
+
skipCleanup: true,
|
|
161
162
|
customHandlers,
|
|
162
163
|
});
|
|
163
164
|
|
package/src/types/run.ts
CHANGED
|
@@ -115,6 +115,8 @@ export type RunConfig = {
|
|
|
115
115
|
returnContent?: boolean;
|
|
116
116
|
tokenCounter?: TokenCounter;
|
|
117
117
|
indexTokenCountMap?: Record<string, number>;
|
|
118
|
+
/** Skip post-stream cleanup (clearHeavyState) — useful for tests that inspect graph state after processStream */
|
|
119
|
+
skipCleanup?: boolean;
|
|
118
120
|
};
|
|
119
121
|
|
|
120
122
|
export type ProvidedCallbacks =
|