# agent: Fix race-condition for LSP tool registration \(\#56044\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 7556cf8ced19cae275fb4d6678858050d4d51df4

Requested commit: 7556cf8ced19cae275fb4d6678858050d4d51df4

Commit: 7556cf8ced19cae275fb4d6678858050d4d51df4

Tree: 869a1e68a58356644a01a33b4f8470f2d38794bb

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Fix race-condition for LSP tool registration (#56044)

This fixes a race condition where the thread would not get the LSP tools
at startup if the feature flag was not resolved yet.
We now always add the tools, but filter them out when we start a new
turn if the feature flag is not set.

Release Notes:

- N/A
```

## Parents

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

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