feat: 优化 Agent 运行时与聊天设置体验

This commit is contained in:
qzl
2026-03-16 18:32:09 +08:00
parent 3f79cf0df7
commit 5a34616287
41 changed files with 2603 additions and 1263 deletions
@@ -87,5 +87,32 @@ void main() {
expect(snapshot.messages, hasLength(1));
expect(snapshot.messages.first.uiSchema, isNotNull);
});
test('parses history user attachments list', () {
final snapshot = HistorySnapshot.fromJson({
'scope': 'history_day',
'threadId': 'thread_1',
'day': '2026-03-16',
'hasMore': false,
'messages': [
{
'id': 'm1',
'seq': 1,
'role': 'user',
'content': '请看图',
'attachments': [
{'url': 'https://signed.example/a.png', 'mimeType': 'image/png'},
{'url': 'https://signed.example/b.jpg', 'mimeType': 'image/jpeg'},
],
'timestamp': '2026-03-16T10:00:00Z',
},
],
});
final userMessage = snapshot.messages.first;
expect(userMessage.attachments, hasLength(2));
expect(userMessage.attachments.first.url, 'https://signed.example/a.png');
expect(userMessage.attachments.last.mimeType, 'image/jpeg');
});
});
}