Skip to content

agent: Account for max_output_tokens in compaction threshold - #59469

Merged
bennetbo merged 1 commit into
mainfrom
fix-compaction-threshold
Jun 17, 2026
Merged

agent: Account for max_output_tokens in compaction threshold#59469
bennetbo merged 1 commit into
mainfrom
fix-compaction-threshold

Conversation

@bennetbo

@bennetbo bennetbo commented Jun 17, 2026

Copy link
Copy Markdown
Member

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

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 17, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 17, 2026
@bennetbo
bennetbo requested a review from rtfeldman June 17, 2026 10:14
@bennetbo
bennetbo added this pull request to the merge queue Jun 17, 2026
@bennetbo

Copy link
Copy Markdown
Member Author

/cherry-pick preview

@zed-zippy

zed-zippy Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

⚠️ This isn't a pull request!

Merged via the queue into main with commit ea035a7 Jun 17, 2026
46 checks passed
@bennetbo
bennetbo deleted the fix-compaction-threshold branch June 17, 2026 11:59
@zed-zippy zed-zippy Bot added the PR state:needs review Used to label PRs that are in need of a post-merge approval label Jun 17, 2026
zed-zippy Bot added a commit that referenced this pull request Jun 17, 2026
… (cherry-pick to preview) (#59475)

Cherry-pick of #59469 to preview

----
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

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
@rtfeldman

Copy link
Copy Markdown
Contributor

@zed-industries/approved

1 similar comment
@rtfeldman

Copy link
Copy Markdown
Contributor

@zed-industries/approved

@zed-zippy zed-zippy Bot removed the PR state:needs review Used to label PRs that are in need of a post-merge approval label Jun 17, 2026
@MrSubidubi

This comment was marked as duplicate.

This was referenced Jun 18, 2026
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ustries#59469) (cherry-pick to preview) (zed-industries#59475)

Cherry-pick of zed-industries#59469 to preview

----
Follow up to zed-industries#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
zed-industries#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

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ustries#59469)

Follow up to zed-industries#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
zed-industries#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants