[Bug]: Android agent alert notifications split into inconsistent stacks and cannot be dismissed in one swipe
Before submitting
- [x] I searched existing issues and did not find a duplicate.
- [x] I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Related issues & PRs (not a duplicate)
- Fix for this issue: #43454 (groups all Android agent alerts into one app-wide collapsible container).
- Separate, complementary work: #42766 / #42847 address repeated alerts replacing each other within a single thread (per-thread slot + ordering), while keeping per-thread
.setGroup(threadGroup). This issue and #43454 address cross-thread grouping so alerts from multiple threads (and batched alerts) share one T3 Code container and can be dismissed in a single swipe. Both PRs solve distinct problems and compose cleanly.
Steps to reproduce
- Run several threads in parallel with mobile push notifications enabled on Android.
- Let alerts accumulate from multiple threads—e.g. one alert each from threads A and B, two alerts from thread C (such as an input/approval alert followed by completion, or two turns), and optionally a multi-thread batch alert.
- Open the Android notification shade and try to dismiss all T3 Code alerts together.
Expected behavior
All T3 Code agent alerts should be grouped inside one collapsible T3 Code notification container (standard Android grouping like Jira/Gmail): expand to tap or dismiss individual thread alerts, or swipe the container once to dismiss all T3 Code alerts, while keeping the ongoing Live Update card separate.
Actual behavior
AgentNotifications.postAlert passes each thread's alert_group to .setGroup(...) and only posts a FLAG_GROUP_SUMMARY once a thread has more than one active alert. Because Android only supports one level of grouping, alerts fragment across up to three different stacks in the same shade:
- Single-alert threads have no summary, so Android leaves them ungrouped or auto-bundles them into an OS
AUTOGROUP_SUMMARY. - Any thread with 2+ alerts gets its own explicit
FLAG_GROUP_SUMMARYand splits out into a separate stack (and because every summary usesPendingIntentrequest code0withFLAG_UPDATE_CURRENT, a second thread's summary overwrites the first's tap target). - Batched multi-thread alerts omit
alert_groupand fall back tot3-agent-alert, forming another separate group.
As a result, users running multiple threads see inconsistent stacks and have to dismiss them across multiple swipes.
Impact
Minor bug or occasional failure
Version or commit
main @ 147028a265
Environment
Android 17 (reproduced on physical Pixel 11 Pro and Pixel 10 Pro Android 17 emulator)