Skip to content

Commit 8eeb0fe

Browse files
authored
Merge branch 'develop' into refactor/standardize-clean-logging
2 parents adb5a4a + 094f3e9 commit 8eeb0fe

File tree

23 files changed

+393
-43
lines changed

23 files changed

+393
-43
lines changed

bun.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"packages/api-client": {
2525
"name": "@elizaos/api-client",
26-
"version": "1.6.5-alpha.10",
26+
"version": "1.6.5-alpha.11",
2727
"dependencies": {
2828
"@elizaos/core": "workspace:*",
2929
},
@@ -36,7 +36,7 @@
3636
},
3737
"packages/app": {
3838
"name": "@elizaos/app",
39-
"version": "1.6.5-alpha.10",
39+
"version": "1.6.5-alpha.11",
4040
"dependencies": {
4141
"@elizaos/api-client": "workspace:*",
4242
"@elizaos/cli": "workspace:*",
@@ -58,7 +58,7 @@
5858
},
5959
"packages/cli": {
6060
"name": "@elizaos/cli",
61-
"version": "1.6.5-alpha.10",
61+
"version": "1.6.5-alpha.11",
6262
"bin": {
6363
"elizaos": "./dist/index.js",
6464
},
@@ -114,7 +114,7 @@
114114
},
115115
"packages/client": {
116116
"name": "@elizaos/client",
117-
"version": "1.6.5-alpha.10",
117+
"version": "1.6.5-alpha.11",
118118
"dependencies": {
119119
"@elizaos/api-client": "workspace:*",
120120
"@elizaos/core": "workspace:*",
@@ -217,15 +217,15 @@
217217
},
218218
"packages/config": {
219219
"name": "@elizaos/config",
220-
"version": "1.6.5-alpha.10",
220+
"version": "1.6.5-alpha.11",
221221
"devDependencies": {
222222
"prettier": "^3.5.3",
223223
"typescript": "^5.8.2",
224224
},
225225
},
226226
"packages/core": {
227227
"name": "@elizaos/core",
228-
"version": "1.6.5-alpha.10",
228+
"version": "1.6.5-alpha.11",
229229
"dependencies": {
230230
"@langchain/core": "^1.0.0",
231231
"@langchain/textsplitters": "^1.0.0",
@@ -251,7 +251,7 @@
251251
},
252252
"packages/elizaos": {
253253
"name": "elizaos",
254-
"version": "1.6.5-alpha.10",
254+
"version": "1.6.5-alpha.11",
255255
"bin": {
256256
"elizaos": "bin/elizaos.js",
257257
},
@@ -261,7 +261,7 @@
261261
},
262262
"packages/plugin-bootstrap": {
263263
"name": "@elizaos/plugin-bootstrap",
264-
"version": "1.6.5-alpha.10",
264+
"version": "1.6.5-alpha.11",
265265
"dependencies": {
266266
"@elizaos/core": "workspace:*",
267267
"@elizaos/plugin-sql": "workspace:*",
@@ -280,7 +280,7 @@
280280
},
281281
"packages/plugin-dummy-services": {
282282
"name": "@elizaos/plugin-dummy-services",
283-
"version": "1.6.5-alpha.10",
283+
"version": "1.6.5-alpha.11",
284284
"dependencies": {
285285
"@elizaos/core": "workspace:*",
286286
"uuid": "^9.0.0",
@@ -295,7 +295,7 @@
295295
},
296296
"packages/plugin-quick-starter": {
297297
"name": "@elizaos/plugin-quick-starter",
298-
"version": "1.6.5-alpha.10",
298+
"version": "1.6.5-alpha.11",
299299
"dependencies": {
300300
"@elizaos/core": "workspace:*",
301301
"zod": "4.1.11",
@@ -309,7 +309,7 @@
309309
},
310310
"packages/plugin-sql": {
311311
"name": "@elizaos/plugin-sql",
312-
"version": "1.6.5-alpha.10",
312+
"version": "1.6.5-alpha.11",
313313
"dependencies": {
314314
"@electric-sql/pglite": "^0.3.3",
315315
"@elizaos/core": "workspace:*",
@@ -331,7 +331,7 @@
331331
},
332332
"packages/plugin-starter": {
333333
"name": "@elizaos/plugin-starter",
334-
"version": "1.6.5-alpha.10",
334+
"version": "1.6.5-alpha.11",
335335
"dependencies": {
336336
"@elizaos/core": "workspace:*",
337337
"@tanstack/react-query": "^5.80.7",
@@ -353,7 +353,7 @@
353353
},
354354
"packages/project-starter": {
355355
"name": "@elizaos/project-starter",
356-
"version": "1.6.5-alpha.10",
356+
"version": "1.6.5-alpha.11",
357357
"dependencies": {
358358
"@elizaos/cli": "workspace:*",
359359
"@elizaos/client": "workspace:*",
@@ -380,7 +380,7 @@
380380
},
381381
"packages/project-tee-starter": {
382382
"name": "@elizaos/project-tee-starter",
383-
"version": "1.6.5-alpha.10",
383+
"version": "1.6.5-alpha.11",
384384
"dependencies": {
385385
"@elizaos/cli": "workspace:*",
386386
"@elizaos/core": "workspace:*",
@@ -412,7 +412,7 @@
412412
},
413413
"packages/server": {
414414
"name": "@elizaos/server",
415-
"version": "1.6.5-alpha.10",
415+
"version": "1.6.5-alpha.11",
416416
"dependencies": {
417417
"@elizaos/core": "workspace:*",
418418
"@elizaos/plugin-sql": "workspace:*",
@@ -440,7 +440,7 @@
440440
},
441441
"packages/service-interfaces": {
442442
"name": "@elizaos/service-interfaces",
443-
"version": "1.6.5-alpha.10",
443+
"version": "1.6.5-alpha.11",
444444
"dependencies": {
445445
"@elizaos/core": "workspace:*",
446446
},
@@ -455,7 +455,7 @@
455455
},
456456
"packages/test-utils": {
457457
"name": "@elizaos/test-utils",
458-
"version": "1.6.5-alpha.10",
458+
"version": "1.6.5-alpha.11",
459459
"dependencies": {
460460
"@elizaos/core": "workspace:*",
461461
"zod": "3.24.2",

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.6.5-alpha.10",
2+
"version": "1.6.5-alpha.11",
33
"packages": [
44
"packages/*"
55
],

packages/api-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/api-client",
3-
"version": "1.6.5-alpha.10",
3+
"version": "1.6.5-alpha.11",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"module": "dist/index.js",

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/app",
3-
"version": "1.6.5-alpha.10",
3+
"version": "1.6.5-alpha.11",
44
"type": "module",
55
"scripts": {
66
"start": "tauri dev",

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/cli",
3-
"version": "1.6.5-alpha.10",
3+
"version": "1.6.5-alpha.11",
44
"description": "elizaOS CLI - Manage your AI agents and plugins",
55
"publishConfig": {
66
"access": "public",

packages/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/client",
3-
"version": "1.6.5-alpha.10",
3+
"version": "1.6.5-alpha.11",
44
"description": "Web client interface for ElizaOS agents",
55
"repository": {
66
"type": "git",

packages/config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@elizaos/config",
33
"description": "Shared configuration for ElizaOS projects and plugins",
4-
"version": "1.6.5-alpha.10",
4+
"version": "1.6.5-alpha.11",
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.js",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elizaos/core",
3-
"version": "1.6.5-alpha.10",
3+
"version": "1.6.5-alpha.11",
44
"description": "",
55
"type": "module",
66
"main": "dist/index.js",

packages/core/src/__tests__/runtime-generation.test.ts

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,81 @@ describe('generateText', () => {
8787
await runtime.generateText(input, {
8888
includeCharacter: false,
8989
temperature: 0.9,
90+
topP: 0.95,
91+
topK: 40,
92+
minP: 0.05,
93+
seed: 42,
94+
repetitionPenalty: 1.1,
9095
maxTokens: 500,
96+
minTokens: 50,
9197
frequencyPenalty: 0.5,
9298
presencePenalty: 0.3,
9399
stopSequences: ['\n\n', 'END'],
100+
user: 'custom-user-id',
101+
responseFormat: { type: 'json_object' },
94102
});
95103

96104
expect(mockUseModel).toHaveBeenCalledTimes(1);
97105

98106
const callArgs = mockUseModel.mock.calls[0];
99107
const params = callArgs[1];
100108
expect(params.temperature).toBe(0.9);
109+
expect(params.topP).toBe(0.95);
110+
expect(params.topK).toBe(40);
111+
expect(params.minP).toBe(0.05);
112+
expect(params.seed).toBe(42);
113+
expect(params.repetitionPenalty).toBe(1.1);
101114
expect(params.maxTokens).toBe(500);
115+
expect(params.minTokens).toBe(50);
102116
expect(params.frequencyPenalty).toBe(0.5);
103117
expect(params.presencePenalty).toBe(0.3);
104118
expect(params.stopSequences).toEqual(['\n\n', 'END']);
119+
expect(params.user).toBe('custom-user-id');
120+
expect(params.responseFormat).toEqual({ type: 'json_object' });
121+
});
122+
123+
it('should auto-populate user from character name when not provided', async () => {
124+
const input = 'Test prompt';
125+
await runtime.generateText(input, {
126+
includeCharacter: false,
127+
});
128+
129+
expect(mockUseModel).toHaveBeenCalledTimes(1);
130+
131+
const callArgs = mockUseModel.mock.calls[0];
132+
const params = callArgs[1];
133+
// Should auto-populate from character name
134+
expect(params.user).toBe('TestBot');
135+
});
136+
137+
it('should preserve explicitly provided empty string for user parameter', async () => {
138+
const input = 'Test prompt';
139+
await runtime.generateText(input, {
140+
includeCharacter: false,
141+
user: '',
142+
});
143+
144+
expect(mockUseModel).toHaveBeenCalledTimes(1);
145+
146+
const callArgs = mockUseModel.mock.calls[0];
147+
const params = callArgs[1];
148+
// Should preserve empty string, not override with character name
149+
expect(params.user).toBe('');
150+
});
151+
152+
it('should preserve explicitly provided null for user parameter', async () => {
153+
const input = 'Test prompt';
154+
await runtime.generateText(input, {
155+
includeCharacter: false,
156+
user: null as any,
157+
});
158+
159+
expect(mockUseModel).toHaveBeenCalledTimes(1);
160+
161+
const callArgs = mockUseModel.mock.calls[0];
162+
const params = callArgs[1];
163+
// Should preserve null, not override with character name
164+
expect(params.user).toBeNull();
105165
});
106166

107167
it('should handle character with array bio', async () => {
@@ -217,4 +277,96 @@ describe('generateText', () => {
217277
expect(params.temperature).toBe(0.3);
218278
expect(params.prompt).toContain('About TestBot'); // Character context included
219279
});
280+
281+
it('should handle responseFormat as string', async () => {
282+
const input = 'Generate JSON';
283+
await runtime.generateText(input, {
284+
includeCharacter: false,
285+
responseFormat: 'json',
286+
});
287+
288+
const callArgs = mockUseModel.mock.calls[0];
289+
const params = callArgs[1];
290+
expect(params.responseFormat).toBe('json');
291+
});
292+
293+
it('should handle empty stopSequences array', async () => {
294+
const input = 'Test prompt';
295+
await runtime.generateText(input, {
296+
includeCharacter: false,
297+
stopSequences: [],
298+
});
299+
300+
const callArgs = mockUseModel.mock.calls[0];
301+
const params = callArgs[1];
302+
expect(params.stopSequences).toEqual([]);
303+
});
304+
305+
it('should handle missing character name for user auto-population', async () => {
306+
const characterNoName: Character = {
307+
id: stringToUuid('no-name'),
308+
name: '',
309+
bio: 'Test bio',
310+
};
311+
312+
runtime = new AgentRuntime({
313+
character: characterNoName,
314+
});
315+
mockUseModel = mock().mockResolvedValue('Response');
316+
runtime.useModel = mockUseModel;
317+
318+
await runtime.generateText('Test', {
319+
includeCharacter: false,
320+
});
321+
322+
const callArgs = mockUseModel.mock.calls[0];
323+
const params = callArgs[1];
324+
// Should use empty string if character name is empty
325+
expect(params.user).toBe('');
326+
});
327+
328+
it('should handle undefined character for user auto-population', async () => {
329+
runtime = new AgentRuntime({
330+
character: undefined as any,
331+
});
332+
mockUseModel = mock().mockResolvedValue('Response');
333+
runtime.useModel = mockUseModel;
334+
335+
await runtime.generateText('Test', {
336+
includeCharacter: false,
337+
});
338+
339+
const callArgs = mockUseModel.mock.calls[0];
340+
const params = callArgs[1];
341+
// Should use undefined if character is missing
342+
expect(params.user).toBeUndefined();
343+
});
344+
345+
it('should handle all parameters being undefined', async () => {
346+
const input = 'Simple prompt';
347+
await runtime.generateText(input, {
348+
includeCharacter: false,
349+
});
350+
351+
const callArgs = mockUseModel.mock.calls[0];
352+
const params = callArgs[1];
353+
354+
// Verify required params exist
355+
expect(params.prompt).toBe('Simple prompt');
356+
expect(params.user).toBe('TestBot'); // Auto-populated
357+
358+
// Verify optional params are not set when not provided
359+
expect(params.maxTokens).toBeUndefined();
360+
expect(params.minTokens).toBeUndefined();
361+
expect(params.temperature).toBeUndefined();
362+
expect(params.topP).toBeUndefined();
363+
expect(params.topK).toBeUndefined();
364+
expect(params.minP).toBeUndefined();
365+
expect(params.seed).toBeUndefined();
366+
expect(params.repetitionPenalty).toBeUndefined();
367+
expect(params.frequencyPenalty).toBeUndefined();
368+
expect(params.presencePenalty).toBeUndefined();
369+
expect(params.stopSequences).toBeUndefined();
370+
expect(params.responseFormat).toBeUndefined();
371+
});
220372
});

0 commit comments

Comments
 (0)