agentgui 1.0.396 → 1.0.397
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 +1 -1
- package/static/js/conversations.js +7 -3
- package/test-wave4-ui.mjs +141 -0
package/package.json
CHANGED
|
@@ -420,8 +420,10 @@ class ConversationManager {
|
|
|
420
420
|
const isStreaming = this.streamingConversations.has(conv.id);
|
|
421
421
|
const title = conv.title || `Conversation ${conv.id.slice(0, 8)}`;
|
|
422
422
|
const timestamp = conv.created_at ? new Date(conv.created_at).toLocaleDateString() : 'Unknown';
|
|
423
|
+
const agent = this.getAgentDisplayName(conv.agentId || conv.agentType);
|
|
424
|
+
const modelLabel = conv.model ? ` (${conv.model})` : '';
|
|
423
425
|
const wd = conv.workingDirectory ? pathBasename(conv.workingDirectory) : '';
|
|
424
|
-
const metaParts = [timestamp];
|
|
426
|
+
const metaParts = [agent + modelLabel, timestamp];
|
|
425
427
|
if (wd) metaParts.push(wd);
|
|
426
428
|
|
|
427
429
|
const titleEl = el.querySelector('.conversation-item-title');
|
|
@@ -446,8 +448,10 @@ class ConversationManager {
|
|
|
446
448
|
|
|
447
449
|
const title = conv.title || `Conversation ${conv.id.slice(0, 8)}`;
|
|
448
450
|
const timestamp = conv.created_at ? new Date(conv.created_at).toLocaleDateString() : 'Unknown';
|
|
449
|
-
const
|
|
450
|
-
const
|
|
451
|
+
const agent = this.getAgentDisplayName(conv.agentId || conv.agentType);
|
|
452
|
+
const modelLabel = conv.model ? ` (${conv.model})` : '';
|
|
453
|
+
const wd = conv.workingDirectory ? pathBasename(conv.workingDirectory) : '';
|
|
454
|
+
const metaParts = [agent + modelLabel, timestamp];
|
|
451
455
|
if (wd) metaParts.push(wd);
|
|
452
456
|
|
|
453
457
|
const streamingBadge = isStreaming
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Wave 4 UI Consistency Test
|
|
4
|
+
* Tests agent/model persistence and display consolidation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import http from 'http';
|
|
8
|
+
|
|
9
|
+
const BASE_URL = process.env.BASE_URL || 'http://localhost:3000';
|
|
10
|
+
const API_BASE = `${BASE_URL}/gm/api`;
|
|
11
|
+
|
|
12
|
+
function request(method, path, body = null) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
const url = new URL(path, API_BASE);
|
|
15
|
+
const options = {
|
|
16
|
+
method,
|
|
17
|
+
headers: body ? { 'Content-Type': 'application/json' } : {}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const req = http.request(url, options, (res) => {
|
|
21
|
+
let data = '';
|
|
22
|
+
res.on('data', chunk => data += chunk);
|
|
23
|
+
res.on('end', () => {
|
|
24
|
+
try {
|
|
25
|
+
resolve({ status: res.statusCode, data: data ? JSON.parse(data) : null });
|
|
26
|
+
} catch (e) {
|
|
27
|
+
resolve({ status: res.statusCode, data });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
req.on('error', reject);
|
|
33
|
+
if (body) req.write(JSON.stringify(body));
|
|
34
|
+
req.end();
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function test() {
|
|
39
|
+
console.log('=== Wave 4 UI Consistency Tests ===\n');
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
// Test 1: Create conversation with specific agent and model
|
|
43
|
+
console.log('Test 1: Create conversation with agent and model');
|
|
44
|
+
const createRes = await request('POST', '/conversations', {
|
|
45
|
+
agentId: 'claude-code',
|
|
46
|
+
title: 'Wave 4 Test Conversation',
|
|
47
|
+
workingDirectory: '/tmp/test',
|
|
48
|
+
model: 'claude-sonnet-4-5'
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
if (createRes.status !== 200) {
|
|
52
|
+
console.error('❌ Failed to create conversation:', createRes.status);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const conversation = createRes.data.conversation;
|
|
57
|
+
console.log('✓ Created conversation:', conversation.id);
|
|
58
|
+
console.log(' - agentId:', conversation.agentId);
|
|
59
|
+
console.log(' - model:', conversation.model);
|
|
60
|
+
|
|
61
|
+
// Test 2: Fetch conversation and verify agent/model are returned
|
|
62
|
+
console.log('\nTest 2: Fetch conversation via /full endpoint');
|
|
63
|
+
const fullRes = await request('GET', `/conversations/${conversation.id}/full`);
|
|
64
|
+
|
|
65
|
+
if (fullRes.status !== 200) {
|
|
66
|
+
console.error('❌ Failed to fetch conversation:', fullRes.status);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const fullConv = fullRes.data.conversation;
|
|
71
|
+
console.log('✓ Fetched conversation');
|
|
72
|
+
console.log(' - agentId:', fullConv.agentId);
|
|
73
|
+
console.log(' - agentType:', fullConv.agentType);
|
|
74
|
+
console.log(' - model:', fullConv.model);
|
|
75
|
+
|
|
76
|
+
if (!fullConv.agentId && !fullConv.agentType) {
|
|
77
|
+
console.error('❌ agentId/agentType missing from response');
|
|
78
|
+
} else {
|
|
79
|
+
console.log('✓ agentId/agentType present');
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!fullConv.model) {
|
|
83
|
+
console.error('❌ model missing from response');
|
|
84
|
+
} else {
|
|
85
|
+
console.log('✓ model present');
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Test 3: List conversations and verify agent/model in list
|
|
89
|
+
console.log('\nTest 3: List conversations');
|
|
90
|
+
const listRes = await request('GET', '/conversations');
|
|
91
|
+
|
|
92
|
+
if (listRes.status !== 200) {
|
|
93
|
+
console.error('❌ Failed to list conversations:', listRes.status);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const listedConv = listRes.data.conversations.find(c => c.id === conversation.id);
|
|
98
|
+
if (!listedConv) {
|
|
99
|
+
console.error('❌ Conversation not found in list');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
console.log('✓ Conversation in list');
|
|
104
|
+
console.log(' - agentId:', listedConv.agentId);
|
|
105
|
+
console.log(' - agentType:', listedConv.agentType);
|
|
106
|
+
console.log(' - model:', listedConv.model);
|
|
107
|
+
|
|
108
|
+
// Test 4: Update conversation model
|
|
109
|
+
console.log('\nTest 4: Update conversation model');
|
|
110
|
+
const updateRes = await request('POST', `/conversations/${conversation.id}`, {
|
|
111
|
+
model: 'claude-opus-4-6'
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (updateRes.status !== 200) {
|
|
115
|
+
console.error('❌ Failed to update conversation:', updateRes.status);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const updatedConv = updateRes.data.conversation;
|
|
120
|
+
console.log('✓ Updated conversation');
|
|
121
|
+
console.log(' - model:', updatedConv.model);
|
|
122
|
+
|
|
123
|
+
if (updatedConv.model !== 'claude-opus-4-6') {
|
|
124
|
+
console.error('❌ Model not updated correctly');
|
|
125
|
+
} else {
|
|
126
|
+
console.log('✓ Model updated correctly');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Cleanup
|
|
130
|
+
console.log('\nCleanup: Deleting test conversation');
|
|
131
|
+
await request('DELETE', `/conversations/${conversation.id}`);
|
|
132
|
+
console.log('✓ Deleted test conversation');
|
|
133
|
+
|
|
134
|
+
console.log('\n=== All Tests Passed ===');
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.error('❌ Test error:', error.message);
|
|
137
|
+
process.exit(1);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
test();
|