# agent: Less disruptive changed file notification \(\#31693\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6df4c537b93b9dde46a4dcde0bbd14ce8998cd10

Requested commit: 6df4c537b93b9dde46a4dcde0bbd14ce8998cd10

Commit: 6df4c537b93b9dde46a4dcde0bbd14ce8998cd10

Tree: 8bb180603e6db76cf63adfa348eb9eafed6fefb2

Author: Oleksiy Syvokon

Committer: GitHub

## Message

```
agent: Less disruptive changed file notification (#31693)

When the user edits one of the tracked files, we used to notify the
agent by inserting a user message at the end of the thread. This was
causing a few problems:
- The agent would stop doing its work and start reading changed files
- The agent would write something like, "Thank you for letting me know
about these changed files."

This fix contains two parts:
1. Changing the prompt to indicate this is a service message
2. Moving the message higher in the conversation thread

This works, but it slightly hurts caching.

We may consider making these notification messages stick in history,
trading context tokens count for the cache.

This might be related to #30906

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
```

## Parents

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

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