# Fix agent notification getting stuck when thread view is dropped \(\#44939\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/be1f824a35f414effa888a3959371a289cb84876)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: be1f824a35f414effa888a3959371a289cb84876

Requested commit: be1f824a35f414effa888a3959371a289cb84876

Commit: be1f824a35f414effa888a3959371a289cb84876

Tree: 5c0cba48a68c5309a76d00aa4ab6f0dfd140cd66

Author: Nathan Sobo

Committer: GitHub

## Message

```
Fix agent notification getting stuck when thread view is dropped (#44939)

Closes #32951

## Summary

When an agent notification was shown and the `AcpThreadView` was dropped
(e.g., by closing the project window or navigating to a new thread), the
notification would become orphaned and undismissable because the
subscriptions handling dismiss events were dropped along with the thread
view.

## Fix

Added an `on_release` callback that closes all notification windows when
the thread view is dropped. This ensures notifications are always
cleaned up properly.

## Testing

Added `test_notification_closed_when_thread_view_dropped` to verify
notifications are closed when the thread view is dropped.

Release Notes:

- Fixed agent notification getting stuck and becoming undismissable when
the project window is closed or when navigating to a new thread
```

## Parents

- [f21cec7cb1d961a0956b97046001117da3bc17f2](https://git.cafe/gitcafe/zed/commit/f21cec7cb1d961a0956b97046001117da3bc17f2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/be1f824a35f414effa888a3959371a289cb84876?format=markdown)
