# agent: Account for max_output_tokens in compaction threshold \(\#59469\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ea035a7a46bd1a9e24aba7f770422f0c81f6f2e5

Requested commit: ea035a7a46bd1a9e24aba7f770422f0c81f6f2e5

Commit: ea035a7a46bd1a9e24aba7f770422f0c81f6f2e5

Tree: 31340f654e3a648f23dbc12b792e0682be4f012e

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Account for max_output_tokens in compaction threshold (#59469)

Follow up to #58883

This makes sure that we subtract the max output tokens before checking
the threshold for auto compaction was reached, we had that logic before
#58883 but we lost it when introducing the settings. Without this GPT
models will run out of tokens before auto-compaction is run

Release Notes:

- (Preview only) Fixed an issue where auto compaction would not be
triggered
```

## Parents

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

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