fix(mobile): keep agent widgets updated in the background #14861
Closed
jakeleventhal(GitHub profile, opens in a new tab)wants to merge 8 commits into
main fromrefs/pull/14861/head·opened View on GitHubShowing 70 changed files with 164 additions and 4 deletions (loading 67).
x
11 additions and 4 deletions+11-4apps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/AgentActivityPresentation.ktModifiedView file
@@ -94,9 +94,11 @@
+ private val workingCount = data["activity_working_count"]?.toIntOrNull()?.coerceAtLeast(0)
+ ?: (activeCount - attentionCount).coerceAtLeast(0)
- val threadCount =
- activeCount + rows.count { ActivityPhase.forStatus(it.status)?.finished == true }
+ val threadCount = data["activity_total_count"]?.toIntOrNull()?.coerceAtLeast(0)
+ ?: (activeCount + rows.count { ActivityPhase.forStatus(it.status)?.finished == true })
@@ -109,7 +111,8 @@
- activeCount > 0 -> "$activeCount working"
+ workingCount > 0 -> "$workingCount working"
🟡 Medium t3agentnotifications/AgentActivityPresentation.kt:114
When all active threads are waiting (for example, stale rows), workingCount and failedCount are both zero, so the summary falls through to All finished even though activeCount is positive. Add an activeCount > 0 fallback so the notification reports those threads as active instead of announcing completion.
No longer relevant as of d9a61d70ebf88f51ce206512cbc3d8ca9a3f429b
+ activeCount > 0 -> "$activeCount active"
@@ -136,7 +139,11 @@