[Bug]: Settling a finished thread doesn't remove it from the iOS Live Activity #16229
Area#
apps/server
Steps to reproduce#
- iPhone with a Dynamic Island, T3 Connect linked, Live Activity Updates on.
- Run a turn until the island shows
T3 · Done. - Settle the thread (sidebar menu, or drag it onto Settled), on any device.
Expected behavior#
The settled thread's row leaves the card. If it was the only row, the Live Activity ends, the same as when you archive the thread.
Actual behavior#
The card keeps showing Done for the settled thread. It stays at least until the 15-minute display window passes, and often for hours because of #11939.
Root cause (main @ c138163c8c)#
shouldPublishAgentAwarenessEventreturnsfalseforthread.settledandthread.unsettled(apps/server/src/relay/AgentAwarenessRelay.ts:109-110). Settling never reaches the relay.projectThreadAwarenessV2(packages/shared/src/agentAwareness.ts:43) doesn't readsettledAt. Even if a publish happened, a settled completed thread would still be published ascompleted.- Archive already handles this:
threadShell.archivedAt !== nullis treated as a missing thread (AgentAwarenessRelay.ts:536), which publishes a tombstone. The relay removes the row and sendslive_activity_endwhen the aggregate is empty.
Suggested fix#
- In
AgentAwarenessRelay, also project a tombstone when the thread is settled and its phase iscompletedorfailed. Do not tombstone a running thread or one waiting on the user, since live work should stay on the card even if it's settled. - Move
thread.settledandthread.unsettledinto the list of events that trigger a publish. The existing publish-identity dedupe keeps settling an already-quiet thread free. - Tests: settling a completed thread publishes a tombstone. Settling a running thread publishes nothing new. Unsettling within the window doesn't re-alert.
Open question: auto-settle would clear the card through the same path. That seems right, since auto-settle only fires after the thread has been idle for a long time.
Related#
- #15728: the same card goes stale after the thread is viewed. That issue has an open cross-device question, but settling is an explicit action, so this fix doesn't depend on that decision.
- Root cause 3 in #15728: same-token re-registration resets
remoteStartedAt, so ends are dropped for 2 minutes after each app open. That would also drop the end for a thread settled on the phone right after opening the app. The fixes should land together, or this one won't work reliably on the phone. - #11939 / #11943: expiry of idle cards.
Workaround#
Archive the thread instead of settling it, or swipe the Live Activity away.
Version or commit#
main @ c138163c8c
juliusmarminge closed this
Sign in to join this conversation.
I'm getting this issue too. Using a tailscale net with "Publish agent activity" on