fix(chat): place agent activity before response
This commit is contained in:
@@ -13,6 +13,7 @@ export function groupRunMessages(messages: Message[], runActive: boolean): Messa
|
||||
const first = assistants[0]
|
||||
result.push({
|
||||
...first,
|
||||
toolMessages: tools.length ? tools : undefined,
|
||||
id: assistants[assistants.length - 1].id,
|
||||
content: assistants.map(m => m.content).filter(text => text.trim()).join('\n\n'),
|
||||
reasoning: assistants.map(m => m.reasoning).filter(Boolean).join('\n\n') || undefined,
|
||||
@@ -20,7 +21,7 @@ export function groupRunMessages(messages: Message[], runActive: boolean): Messa
|
||||
isStreaming: assistants.some(m => m.isStreaming),
|
||||
})
|
||||
}
|
||||
if (tools.length) {
|
||||
if (tools.length && !assistants.length) {
|
||||
result.push({ id: `tool-group-${tools[0].id}`, role: 'system', content: '', timestamp: tools[0].timestamp, systemType: 'tool-group', toolMessages: tools })
|
||||
}
|
||||
if (completed && assistants.length) {
|
||||
|
||||
Reference in New Issue
Block a user