agentgui 1.0.549 → 1.0.550
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/server.js +7 -3
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1005,10 +1005,14 @@ const server = http.createServer(async (req, res) => {
|
|
|
1005
1005
|
|
|
1006
1006
|
if (pathOnly === '/api/conversations' && req.method === 'GET') {
|
|
1007
1007
|
const conversations = queries.getConversationsList();
|
|
1008
|
-
// Filter out stale streaming state
|
|
1008
|
+
// Filter out stale streaming state: check both activeExecutions AND database active sessions
|
|
1009
1009
|
for (const conv of conversations) {
|
|
1010
|
-
if (conv.isStreaming
|
|
1011
|
-
conv.
|
|
1010
|
+
if (conv.isStreaming) {
|
|
1011
|
+
const hasActiveSession = queries.getSessionsByStatus(conv.id, 'active').length > 0 ||
|
|
1012
|
+
queries.getSessionsByStatus(conv.id, 'pending').length > 0;
|
|
1013
|
+
if (!activeExecutions.has(conv.id) && !hasActiveSession) {
|
|
1014
|
+
conv.isStreaming = 0;
|
|
1015
|
+
}
|
|
1012
1016
|
}
|
|
1013
1017
|
}
|
|
1014
1018
|
sendJSON(req, res, 200, { conversations });
|