# No longer instantiate recently opened agent threads on startup \(\#32285\) · gitcafe/zed

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

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

Visibility: public

Requested revision: cabd22f36b7251b46aafbff817c1d79f869d2138

Requested commit: cabd22f36b7251b46aafbff817c1d79f869d2138

Commit: cabd22f36b7251b46aafbff817c1d79f869d2138

Tree: 5419ddb1cb66d78766233699584fa80e8bd4e115

Author: Michael Sloan

Committer: GitHub

## Message

```
No longer instantiate recently opened agent threads on startup (#32285)

This was causing a lot of work on startup, particularly due to
instantiating edit tool cards. The minor downside is that now these
threads don't open quite as fast.

Includes a few other improvements:

* On text thread rename, now immediately updates the metadata for
display in the UI instead of waiting for reload.

* On text thread rename, first renames the file before writing. Before
if the file removal failed you'd end up with a duplicate.

* Now only stores text thread file names instead of full paths. This is
more concise and allows for the app data dir changing location.

* Renames `ThreadStore::unordered_threads` to
`ThreadStore::reverse_chronological_threads` (and removes the old one
that sorted), since the recent change to use a SQL database queries them
in that order.

* Removes `ContextStore::reverse_chronological_contexts` since it was
only used in one location where it does sorting anyway - no need to sort
twice.

* `SavedContextMetadata::title` is now `SharedString` instead of
`String`.

Release Notes:

- Fixed regression in startup performance by not deserializing and
instantiating recently opened agent threads.
```

## Parents

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

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