# agent: Save threads before closing them \(\#51744\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8a25373fb98bc60b053311dadd7b1e75cd96074c

Requested commit: 8a25373fb98bc60b053311dadd7b1e75cd96074c

Commit: 8a25373fb98bc60b053311dadd7b1e75cd96074c

Tree: dc3a835a4bfe974939cea6fb4cf9d775f40fc365

Author: Ben Brandt

Committer: GitHub

## Message

```
agent: Save threads before closing them (#51744)

Closes #46078

When we unloaded sessions, we weren't necesarily making sure we had
saved the current state. Now we save it whenever we remove it from the
session map.

Release Notes:

- Agent: Fix cases where thread state wasn't saved before closing the
thread.
```

## Parents

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

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