Add auto_compact agent settings - #58883
Merged
Merged
Conversation
rtfeldman
force-pushed
the
agent-auto-compact-settings
branch
from
June 9, 2026 01:31
5dd2757 to
bced27b
Compare
rtfeldman
marked this pull request as ready for review
June 9, 2026 06:18
rtfeldman
force-pushed
the
agent-auto-compact-settings
branch
from
June 9, 2026 06:22
160e155 to
96c6103
Compare
NsdHSO
pushed a commit
to NsdHSO/zed
that referenced
this pull request
Jun 17, 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
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>
This was referenced Jun 18, 2026
Closed
This was referenced Jul 1, 2026
This was referenced Jul 10, 2026
jonx
pushed a commit
to jonx/zed-aros
that referenced
this pull request
Jul 17, 2026
Adds two new agent settings nested under `auto_compact`, `enabled` and `threshold`, which control automatic compaction of the agent's context window as part of the handoff feature. Both surface in the settings UI under Agent Configuration, gated behind the `handoff` feature flag so they only appear for users on that flag. The `threshold` accepts three forms: a percentage string ending in `%` (e.g. `"80%"` or `"95.5%"`) measured against the model's context window, a positive integer to compact after that many tokens have been used, or a negative integer to compact once that many tokens remain in the window. `0` and bare non-integer numbers are rejected. It deserializes from either a JSON string or integer and resolves to a typed enum, falling back to the `"80%"` default (with a logged warning) when the configured value is invalid. In the settings UI the threshold is a free-form text field so all three forms can be entered. Release Notes: - N/A --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
jolutz
pushed a commit
to jolutz/zed
that referenced
this pull request
Aug 8, 2026
Adds two new agent settings nested under `auto_compact`, `enabled` and `threshold`, which control automatic compaction of the agent's context window as part of the handoff feature. Both surface in the settings UI under Agent Configuration, gated behind the `handoff` feature flag so they only appear for users on that flag. The `threshold` accepts three forms: a percentage string ending in `%` (e.g. `"80%"` or `"95.5%"`) measured against the model's context window, a positive integer to compact after that many tokens have been used, or a negative integer to compact once that many tokens remain in the window. `0` and bare non-integer numbers are rejected. It deserializes from either a JSON string or integer and resolves to a typed enum, falling back to the `"80%"` default (with a logged warning) when the configured value is invalid. In the settings UI the threshold is a free-form text field so all three forms can be entered. Release Notes: - N/A --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two new agent settings nested under
auto_compact,enabledandthreshold, which control automatic compaction of the agent's context window as part of the handoff feature. Both surface in the settings UI under Agent Configuration, gated behind thehandofffeature flag so they only appear for users on that flag.The
thresholdaccepts three forms: a percentage string ending in%(e.g."80%"or"95.5%") measured against the model's context window, a positive integer to compact after that many tokens have been used, or a negative integer to compact once that many tokens remain in the window.0and bare non-integer numbers are rejected. It deserializes from either a JSON string or integer and resolves to a typed enum, falling back to the"80%"default (with a logged warning) when the configured value is invalid. In the settings UI the threshold is a free-form text field so all three forms can be entered.Release Notes: