Fix session sort key overload clash

This commit is contained in:
OpenClaw committed 2026-03-07 13:02:25 +08:00
1 parent b3f009d644
commit aa314ec084
2 files changed
+5 -4

No files matched your search

@@ -112,7 +112,7 @@ class RemoteOpenClawRepository(
override fun hydrateOverview(snapshot: OverviewSnapshot) {
availableAgents = snapshot.availableAgents
sessions = snapshot.sessions.map { it.toDomain() }
rebuildSessionSortKeys(snapshot.sessions)
rebuildSessionSortKeysFromSnapshot(snapshot.sessions)
status = snapshot.status.toDomain()
}
@@ -396,7 +396,7 @@ class RemoteOpenClawRepository(
suspend fun refreshSessions() {
sessions = api.getSessions().map { dto -> dto.toDomain() }
rebuildSessionSortKeys(sessions)
rebuildSessionSortKeysFromSessions(sessions)
resortSessions(prioritizeId = recentSessionId)
}
@@ -912,7 +912,7 @@ class RemoteOpenClawRepository(
}
}
private fun rebuildSessionSortKeys(items: List<OverviewSessionSnapshot>) {
private fun rebuildSessionSortKeysFromSnapshot(items: List<OverviewSessionSnapshot>) {
val total = items.size.toLong()
items.forEachIndexed { index, session ->
val fallback = (total - index).coerceAtLeast(1L)
@@ -920,7 +920,7 @@ class RemoteOpenClawRepository(
}
}
private fun rebuildSessionSortKeys(items: List<SessionSummary>) {
private fun rebuildSessionSortKeysFromSessions(items: List<SessionSummary>) {
val total = items.size.toLong()
items.forEachIndexed { index, session ->
val fallback = (total - index).coerceAtLeast(1L)