mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-28 23:48:39 +02:00
fix: preserve toolArguments through normalization and activity state
- Add toolArguments to normalizeRunTimelineEvent output so persisted sessions retain tool argument data across app restarts - Add toolArguments field to AgentActivityState and propagate it in applySessionEventActivity for real-time activity labels - Add tests for normalization round-trip with and without toolArguments - Add test for activity state including toolArguments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -99,6 +99,32 @@ describe('session activity helpers', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('includes toolArguments in activity state', () => {
|
||||
const event: SessionEventRecord = {
|
||||
sessionId: 'session-1',
|
||||
kind: 'agent-activity',
|
||||
occurredAt: '2026-03-23T00:00:00.000Z',
|
||||
activityType: 'tool-calling',
|
||||
agentId: 'architect',
|
||||
agentName: 'Architect',
|
||||
toolName: 'view',
|
||||
toolArguments: { path: 'src/main.ts', view_range: [1, 50] },
|
||||
};
|
||||
|
||||
const result = applySessionEventActivity({}, event);
|
||||
expect(result).toEqual({
|
||||
'session-1': {
|
||||
architect: {
|
||||
agentId: 'architect',
|
||||
agentName: 'Architect',
|
||||
activityType: 'tool-calling',
|
||||
toolName: 'view',
|
||||
toolArguments: { path: 'src/main.ts', view_range: [1, 50] },
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test('warns when an agent-activity event is missing identifiers', () => {
|
||||
const originalWarn = console.warn;
|
||||
const warnings: unknown[][] = [];
|
||||
|
||||
Reference in New Issue
Block a user