# assistant2: Fix thread history only working in one Zed window \(\#25119\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 98ea659af6e5be39e3360093aa6e66c1ea801c1a

Requested commit: 98ea659af6e5be39e3360093aa6e66c1ea801c1a

Commit: 98ea659af6e5be39e3360093aa6e66c1ea801c1a

Tree: 0bf772e02fd2906f60896f016c6743a5a24dfd48

Author: Marshall Bowers

Committer: GitHub

## Message

```
assistant2: Fix thread history only working in one Zed window (#25119)

This PR fixes an issue where the thread history would only work in one
Zed window at a time.

The backing LMDB database can only be opened once per Zed instance.
However, the `ThreadStore` has one instance per Zed window.

To fix this, we need to create the `heed` environment once and store it
as a global, and then reference the same environment across all of the
`ThreadStore`s.

Release Notes:

- N/A
```

## Parents

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

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