# acp: Fix agent servers sometimes not being registered when Zed starts \(\#38330\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ea473eea875dcdbca05a3e98d10117724cdad935

Requested commit: ea473eea875dcdbca05a3e98d10117724cdad935

Commit: ea473eea875dcdbca05a3e98d10117724cdad935

Tree: 1af13929158f793c3255ba6658b87ce59edf621c

Author: Cole Miller

Committer: GitHub

## Message

```
acp: Fix agent servers sometimes not being registered when Zed starts (#38330)

In local projects, initialize the list of agents in the agent server
store immediately. Previously we were initializing the list only after a
delay, in an attempt to avoid sending the `ExternalAgentsUpdated`
message to the downstream client (if any) before its handlers were
initialized. But we already have a separate codepath for that situation,
in the `AgentServerStore::shared`, and we can insert the delay in that
place instead.

Release Notes:

- acp: Fixed a bug where starting an external agent thread soon after
Zed starts up would show a "not registered" error.

---------

Co-authored-by: Michael <michael@zed.dev>
Co-authored-by: Agus <agus@zed.dev>
```

## Parents

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

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