Repository navigation
harbor: remove extra DeepSeek Harness compaction headroom - #1796
Merged
Merged
Conversation
… fits dsh's compaction-basic compacts at min(0.8 x window, window - maxTokens - headroomTokens), with headroomTokens 65536 by default. With a 131072-token window and 32768-token replies that is 32768 tokens, while a compaction keeps 0.16 x 98304 tokens, so the context is back at the threshold after every summary and dsh compacts again on nearly every step. Set headroomTokens to 0 in the profile patch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
The docs for this pull request are available at https://openenv.github.io/OpenEnv/pr-preview/pr-1796/ (commit dbde1d7). The preview may take a minute to update and is removed when the pull request closes. |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8be30cf. Configure here.
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.

What
profile_patchconfigures dsh'scompaction-basicwithheadroomTokens: 0and an explicit summary token limit. The limit is the smaller of the route's reply budget and dsh's default of 65,536. The pinned release requires a positive summary limit and would otherwise inherit zero fromheadroomTokens.Why
dsh's
compaction-basiccompacts atmin(0.8 × contextWindow, contextWindow − maxTokens − headroomTokens), andheadroomTokensdefaults to 65536, which is sized for DeepSeek's 1M window. With a 131072-token window and 32768-token replies, that threshold is 32768 tokens. A compaction keeps0.16 × (131072 − 32768)≈ 15.7k tokens. Once the system prompt, tools and summary are added, the context is back at the threshold right after each summary, so dsh compacts again on nearly every step.On Terminal-Bench 2.1, Inkling-2-Mini, 131072 window, 32768-token replies:
With
headroomTokens: 0, dsh compacts at the earlier of 80% of the context window or the point where it has just enough space for a full reply.The entry id
compaction-basicis the one declared in dsh's base layer (@deepseek-ai/dsh-base,cordis.patch.yml). That layer gives it no config, so this patch is its only config.Test plan
tests/envs/test_harbor_deepseek_harness.pywith Harbor 0.25.0. All 11 tests passed, including the bundle install test.🤖 Generated with Claude Code
Note
Low Risk
Targets DeepSeek Harness profile generation and tests only; no auth, infra, or shared runtime paths beyond dsh rollout config.
Overview
DeepSeek Harness profile patches now configure compaction so agents with smaller served context windows (e.g. 131k) do not trigger dsh’s step compaction on almost every turn.
profile_patchadds acompaction-basicentry withheadroomTokens: 0andmaxTokenscapped atmin(65_536, max_tokens), overriding dsh’s default 65k headroom sized for 1M contexts.The module docstring is updated to mention this compaction policy. A parametrized test checks the new patch entry across several window/reply budgets.
Reviewed by Cursor Bugbot for commit dbde1d7. Bugbot is set up for automated code reviews on this repo. Configure here.