mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-14 12:00:18 -07:00
fix(patch): cherry-pick d6f88f8 to release/v0.39.0-preview.1-pr-25670 to patch version v0.39.0-preview.1 and create version 0.39.0-preview.2 (#25776)
Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com>
This commit is contained in:
@@ -538,5 +538,52 @@ describe('a2aUtils', () => {
|
||||
expect(output).toContain('Artifact (Data):');
|
||||
expect(output).not.toContain('Answer from history');
|
||||
});
|
||||
|
||||
it('should return message log as activity items', () => {
|
||||
const reassembler = new A2AResultReassembler();
|
||||
|
||||
reassembler.update({
|
||||
kind: 'status-update',
|
||||
taskId: 't1',
|
||||
contextId: 'ctx1',
|
||||
status: {
|
||||
state: 'working',
|
||||
message: {
|
||||
kind: 'message',
|
||||
role: 'agent',
|
||||
parts: [{ kind: 'text', text: 'Message 1' }],
|
||||
} as Message,
|
||||
},
|
||||
} as unknown as SendMessageResult);
|
||||
|
||||
reassembler.update({
|
||||
kind: 'status-update',
|
||||
taskId: 't1',
|
||||
contextId: 'ctx1',
|
||||
status: {
|
||||
state: 'working',
|
||||
message: {
|
||||
kind: 'message',
|
||||
role: 'agent',
|
||||
parts: [{ kind: 'text', text: 'Message 2' }],
|
||||
} as Message,
|
||||
},
|
||||
} as unknown as SendMessageResult);
|
||||
|
||||
const items = reassembler.toActivityItems();
|
||||
expect(items).toHaveLength(2);
|
||||
expect(items[0]).toEqual({
|
||||
id: 'msg-0',
|
||||
type: 'thought',
|
||||
content: 'Message 1',
|
||||
status: 'completed',
|
||||
});
|
||||
expect(items[1]).toEqual({
|
||||
id: 'msg-1',
|
||||
type: 'thought',
|
||||
content: 'Message 2',
|
||||
status: 'completed',
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user