# agent: Handle attempts to use hallucinated tools \(\#29946\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8199664a5a5e94a1bafab88f4405e6dfa458957d

Requested commit: 8199664a5a5e94a1bafab88f4405e6dfa458957d

Commit: 8199664a5a5e94a1bafab88f4405e6dfa458957d

Tree: c29f62aeb595ce289156b0fd4ea2ad8da0487ddd

Author: Oleksiy Syvokon

Committer: GitHub

## Message

```
agent: Handle attempts to use hallucinated tools (#29946)

This change:

1. Catches attempts to use missing tools. If this happens, we now send
Agent a message listing available tools, after which Agent can
gracefully recover. Prior behavior: thread would stop in a broken state.

Example of a hallucinated call and a message we send back: 

![image](https://github.com/user-attachments/assets/92a8f700-b192-4038-8c7e-0a74ca2e0146)

2. Adds evals for hallucinated tool use and imagined edits
3. Adds ability to configure a profile name in evals.



Release Notes:

- N/A
```

## Parents

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

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