# acp: Add a timeout when initializing an ACP agent so the user isn't waiting forever \(\#43663\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 007d648f5e9a3cc2df5964435b89d854955c077e

Requested commit: 007d648f5e9a3cc2df5964435b89d854955c077e

Commit: 007d648f5e9a3cc2df5964435b89d854955c077e

Tree: f8027c3be504300b824b5f0ed4f490e8e890cab8

Author: Ben Brandt

Committer: GitHub

## Message

```
acp: Add a timeout when initializing an ACP agent so the user isn't waiting forever (#43663)

Sometimes we are unable to receive messages at all from an agent. This
puts on upper bound on the `initialize` call so we can at least give a
message to the user that something is wrong here.

30s might feel like too long, but I wanted to avoid some false positives
in case there was something an agent needed to do at startup. This will
still communicate to the user at some point that something is wrong,
rather than leave them waiting forever with no signal that something is
going wrong.

Release Notes:

- agent: Show an error message to the user if we are unable to
initialize an ACP agent in a reasonable amount of time.
```

## Parents

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

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