feat: forward tool.started/completed events in SSE stream
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 35s

This commit is contained in:
WangDL 2026-05-22 17:20:28 +08:00
parent ff56b79659
commit fc2725b5df

View File

@ -142,6 +142,12 @@ export class AdminAiChatService {
// Forward to client
res.write(`data: ${JSON.stringify({ ...event, runId })}\n\n`);
// Forward tool events
if (event.event === 'tool.started' || event.event === 'tool.completed') {
res.write(`data: ${JSON.stringify({ event: event.event, tool: (event as any).tool, preview: (event as any).preview, duration: (event as any).duration, error: (event as any).error })}
`);
}
if (event.event === 'message.delta' && event.delta) {
fullResponse += event.delta;
} else if (event.event === 'run.completed') {