# agent: Fix race where compaction would be marked as cancelled \(\#59014\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5c90b0664fe112bc7c788eeabda2c4240b722f94

Requested commit: 5c90b0664fe112bc7c788eeabda2c4240b722f94

Commit: 5c90b0664fe112bc7c788eeabda2c4240b722f94

Tree: 637d201b68015eceb3bfdf6d29ae46e3eeea43c0

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Fix race where compaction would be marked as cancelled (#59014)

Fixes an issue where compaction would get marked as cancelled if the
previous turn took a while to cancel. E.g. you could reproduce this when
sending a normal message, and then interrupting generation by sending
`/compact`. If the task for the prior turn took a while to complete, it
would mark the compaction triggered by `/compact` as cancelled, even
though it was not.

Release Notes:

- N/A
```

## Parents

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

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