Ctrl+Shift+R: Refresh-Status korrekt wiederherstellen
API /incidents/refreshing gibt jetzt auch queued IDs mit Position und den aktuell laufenden Task zurueck. Frontend nutzt started_at aus der API fuer Timer-Wiederherstellung. Queued Lagen werden mit korrekter Position wiederhergestellt. Aktiv laufender Task wird als researching angezeigt statt queued. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -150,8 +150,16 @@ async def get_refreshing_incidents(
|
|||||||
(tenant_id, current_user["id"]),
|
(tenant_id, current_user["id"]),
|
||||||
)
|
)
|
||||||
rows = await cursor.fetchall()
|
rows = await cursor.fetchall()
|
||||||
|
|
||||||
|
# Also include queued incidents from orchestrator
|
||||||
|
from agents.orchestrator import orchestrator
|
||||||
|
queued_ids = list(orchestrator._queued_ids) if hasattr(orchestrator, '_queued_ids') else []
|
||||||
|
current_task = orchestrator._current_task if hasattr(orchestrator, '_current_task') else None
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"refreshing": [row["incident_id"] for row in rows],
|
"refreshing": [row["incident_id"] for row in rows],
|
||||||
|
"queued": queued_ids,
|
||||||
|
"current": current_task,
|
||||||
"details": {str(row["incident_id"]): {"started_at": row["started_at"]} for row in rows},
|
"details": {str(row["incident_id"]): {"started_at": row["started_at"]} for row in rows},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -574,14 +574,34 @@ const App = {
|
|||||||
// Laufende Refreshes wiederherstellen
|
// Laufende Refreshes wiederherstellen
|
||||||
try {
|
try {
|
||||||
const data = await API.getRefreshingIncidents();
|
const data = await API.getRefreshingIncidents();
|
||||||
|
const details = data.details || {};
|
||||||
|
const currentTask = data.current;
|
||||||
|
const queuedIds = data.queued || [];
|
||||||
|
|
||||||
|
// Restore running refreshes
|
||||||
if (data.refreshing && data.refreshing.length > 0) {
|
if (data.refreshing && data.refreshing.length > 0) {
|
||||||
data.refreshing.forEach(id => this._refreshingIncidents.add(id));
|
|
||||||
// Sidebar-Dots aktualisieren
|
|
||||||
data.refreshing.forEach(id => {
|
data.refreshing.forEach(id => {
|
||||||
this._updateSidebarDot(id);
|
this._refreshingIncidents.add(id);
|
||||||
// Init progress state so sidebar renders correctly
|
const d = details[String(id)] || {};
|
||||||
UI.showProgress('researching', {}, id, false);
|
const inc = this.incidents.find(i => i.id === id);
|
||||||
|
const isFirst = inc && !inc.summary;
|
||||||
|
const isCurrent = (id === currentTask);
|
||||||
|
// Use 'researching' as default step for the actively running task
|
||||||
|
UI.showProgress(isCurrent ? 'researching' : 'queued', { started_at: d.started_at }, id, isFirst);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore queued incidents
|
||||||
|
if (queuedIds.length > 0) {
|
||||||
|
queuedIds.forEach((id, idx) => {
|
||||||
|
this._refreshingIncidents.add(id);
|
||||||
|
const inc = this.incidents.find(i => i.id === id);
|
||||||
|
const isFirst = inc && !inc.summary;
|
||||||
|
UI.showProgress('queued', { queue_position: idx + 1 }, id, isFirst);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.refreshing.length > 0 || queuedIds.length > 0) {
|
||||||
this.renderSidebar();
|
this.renderSidebar();
|
||||||
}
|
}
|
||||||
} catch (e) { /* Kein kritischer Fehler */ }
|
} catch (e) { /* Kein kritischer Fehler */ }
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren