refactor(ui): Make message status SSE name more specific
Signed-off-by: Richard Palethorpe <io@richiejp.com>
This commit is contained in:
@@ -370,7 +370,7 @@ func (a *App) Chat(pool *state.AgentPool) func(c *fiber.Ctx) error {
|
|||||||
xlog.Error("Error marshaling status message", "error", err)
|
xlog.Error("Error marshaling status message", "error", err)
|
||||||
} else {
|
} else {
|
||||||
manager.Send(
|
manager.Send(
|
||||||
sse.NewMessage(string(statusData)).WithEvent("json_status"))
|
sse.NewMessage(string(statusData)).WithEvent("json_message_status"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process the message asynchronously
|
// Process the message asynchronously
|
||||||
@@ -417,7 +417,7 @@ func (a *App) Chat(pool *state.AgentPool) func(c *fiber.Ctx) error {
|
|||||||
xlog.Error("Error marshaling completed status", "error", err)
|
xlog.Error("Error marshaling completed status", "error", err)
|
||||||
} else {
|
} else {
|
||||||
manager.Send(
|
manager.Send(
|
||||||
sse.NewMessage(string(completedData)).WithEvent("json_status"))
|
sse.NewMessage(string(completedData)).WithEvent("json_message_status"))
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
4
webui/react-ui/src/hooks/useSSE.js
vendored
4
webui/react-ui/src/hooks/useSSE.js
vendored
@@ -63,8 +63,8 @@ export function useSSE(agentName) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Handle 'json_status' event
|
// Handle 'json_message_status' event
|
||||||
eventSource.addEventListener('json_status', (event) => {
|
eventSource.addEventListener('json_message_status', (event) => {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
const timestamp = data.timestamp || new Date().toISOString();
|
const timestamp = data.timestamp || new Date().toISOString();
|
||||||
|
|||||||
Reference in New Issue
Block a user