[Bug]: Changing the model on a finished thread sends a new "Done" alert to the phone
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 with agent activity publishing on, and enable Device Notifications on an iPhone.
- Run a turn in a thread and let it finish. The phone gets one "Done: " alert.
- Wait more than 15 minutes, or more than 2 minutes if Live Activities are off.
- Open the finished thread's settings on any client and pick a different model. Do not send a message.
Expected behavior
No alert. Nothing finished. The Live Activity may repaint the model name, but the phone stays quiet.
Actual behavior
The phone gets a fresh "Done: " alert. Every later model change on that idle thread rings again. It also happens while the phone is open on another thread, so it reads as random "Done" spam during monitoring.
Impact
Major degradation or frequent failure
Version or commit
main @ 3efdcc529
Environment
iOS 26, T3 Code Nightly 0.0.41, T3 Connect linked, Live Activities on.
Logs or stack traces
Root cause, from reading the code rather than logs:
packages/shared/src/agentAwareness.ts stamps every awareness state with thread.updatedAt.
A model change lands as thread.meta-updated, which bumps thread.updatedAt and changes
modelTitle, so AgentAwarenessRelay republishes the thread as "completed" with a timestamp
of "now".
infra/relay/src/agentActivity/agentActivityAlerts.ts treats a completed row as alertable
when it is fresh (2 minutes) and the device has no non-terminal baseline for it. With no
armed card, notificationForAggregate only checks freshness. With an armed card whose Done
row already aged out of the aggregate, newlyTerminalRows(includeUnobserved) treats the row
as new. Both paths ring.
Screenshots, recordings, or supporting files
No response
Workaround
Do not change the model on a finished thread until you send the next message, or turn off "Notify on completion".
Related: #11886 covers the same freshness hole on server restart, and #9057 on auto-settlement. Open PR #9081 pins the terminal updatedAt to the turn or session end instead of thread.updatedAt, which stops this trigger too. This issue records the model-change repro so it can be verified when that lands.
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
Review PR #9081 alongside packages/shared/src/agentAwareness.ts and infra/relay/src/agentActivity/agentActivityAlerts.ts; start with the model-change reproduction described here. Repeat the iPhone notification steps and verify that changing the model on a finished thread does not send another "Done" alert.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100