[Bug]: iOS Live Activity keeps showing "T3 Done" for hours when no other agent event arrives
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/mobile
Steps to reproduce
- Link an environment to T3 Connect, enable Live Activity Updates on an iPhone, and start a turn from the phone so a Live Activity is armed.
- Let the turn finish. The Dynamic Island and lock screen card switch to "T3 Done".
- Tap the notification or the Dynamic Island. The thread opens in the app.
- Leave the phone alone. Do not start any other agent work on any linked environment.
- Check the Dynamic Island 30 minutes later, or hours later.
Expected behavior
The Done card stays for the documented 15 minute window, then goes away on its own.
Actual behavior
The Dynamic Island keeps saying "T3 Done" for hours. Tapping the notification or the island does not clear it. It only goes away when some other agent event reaches the phone, or when iOS retires the activity itself.
Impact
Minor bug or occasional failure
Version or commit
main @ 3efdcc529
Environment
iOS 26, T3 Code Mobile with T3 Connect, T3 Code Nightly 0.0.41 as the host.
Logs or stack traces
Root cause, from reading the relay code:
infra/relay/src/agentActivity/agentActivityAggregate.ts keeps finished rows in the aggregate
for 15 minutes and returns null after that, and ApnsDeliveries turns a null aggregate into a
live_activity_end. But the aggregate is only recomputed when an environment publishes a new
state or the app re-registers its activity token. A user with no further agent activity never
triggers either, so the end push is never sent.
Opening the app does re-register the token, but inside the 15 minute window that replay just
re-sends the same Done aggregate. After the window, nothing runs at all. The 5 minute cron in
infra/relay/src/worker.ts prunes the terminal rows from the database but does not end the
cards that were showing them.
Screenshots, recordings, or supporting files
No response
Workaround
Start another turn on any linked environment, or open the app again more than 15 minutes after the turn finished so the token re-registration replays an empty aggregate and ends the card.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with infra/relay/src/agentActivity/agentActivityAggregate.ts and infra/relay/src/worker.ts, then trace how ApnsDeliveries handles a null aggregate and how activity tokens are re-registered. Reproduce a completed turn with no later agent event and observe the 15-minute boundary. Done means the iOS Live Activity receives its end update after 15 minutes without another event or app launch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- backend, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100