fix(vscode-lm): reliable auto context condensing + 3.53.1#11
Merged
Conversation
added 2 commits
June 22, 2026 11:02
Treat maxTokens:-1 (unlimited) as the default output reserve instead of a hard cap, and measure contextPercent against available input space so the condense gate fires reliably on the VS Code LM provider. Add a getCondenseContextWindow() seam that drives the condense gate from the curated model maxInputTokens rather than the inflated live context window. Refresh the VS Code LM model catalog and update the default model. Bump the extension to 3.53.1 and add the vscode-lm-condense-fix changeset.
Restores the upstream v3.54.0 changeset that was removed in 8ed3455; that file originated upstream (Release v3.54.0 RooCodeInc#12369) and should not have been deleted.
9 tasks
easonLiangWorldedtech
pushed a commit
to easonLiangWorldedtech/Zoo-Code
that referenced
this pull request
Jul 1, 2026
* fix(vscode-lm): reliable auto context condensing Port of simurg79/Roo-Code#11 into Zoo-Code. * test(vscode-lm): cover condense-window edge branches for codecov/patch Add targeted tests for the previously-uncovered ported branches: the availableInputTokens<=0 fallback to 100% in willManageContext/manageContext, getCondenseContextWindow() guard fallbacks, and the vscode-lm UI family-miss window resolution. Raises patch coverage to satisfy the codecov/patch 80% gate. * chore(vscode-lm): address review — drop changeset, fix condense-window guard test - Remove .changeset/vscode-lm-condense-fix.md (changesets are maintainer-managed per AGENTS.md; CodeRabbit flagged). - Fix getCondenseContextWindow() non-positive-guard test so the selector family (claude-opus-4.8) drives the lookup and the zeroed static row actually exercises the maxInputTokens > 0 guard before falling back. * fix(vscode-lm): scope available-input condense denominator to vscode-lm; address review Address review feedback from edelauna on Zoo-Code-Org#710: - Scope the available-input-space condense percent denominator to vscode-lm only (via the getCondenseContextWindow seam); all other providers keep dividing by the full context window. The maxTokens:-1 reserve guard remains global. - Correct the misleading useSelectedModel comment: the gate's primary window is getCondenseContextWindow() (static maxInputTokens), not getModel().info.contextWindow. - Strengthen the listed-family test with a claude-opus-4.8 case (contextWindow != maxInputTokens) to catch a field swap. * docs(vscode-lm): tighten auto-condense comments Simplify comments added in PR Zoo-Code-Org#710 to be brief and rationale-focused; no logic, assertions, or test values changed. * test(vscode-lm): harden condense reserve-guard coverage Address review: make the negative-reserve percent test discriminate the maxTokens>0 guard (-200000), and add a manageContext truncation-path test so both copies of the -1 reserve guard are covered. Test-only; no product code changed. * test(task): fix Task.dispose teardown-race flake Mock utils/storage and OutputInterceptor in Task.dispose.test.ts so dispose()'s unawaited cleanup chain cannot emit a late console.error during Vitest worker teardown (EnvironmentTeardownError: Closing rpc while onUserConsoleLog was pending). Test-only; no product code changed. * refactor(vscode-lm): default-row condense fallback + shared contextPercent helper getCondenseContextWindow() resolves the default vscode-lm row for an unknown/absent family (catalog drift) instead of the inflated live window; only a non-positive static maxInputTokens still falls back to it. Extract the duplicated contextPercent math shared by willManageContext and manageContext into computeContextPercent so the two stay in lockstep. Addresses PR review feedback. --------- Co-authored-by: Bertan Ari <bertanari@microsoft.com>
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.
Fixes unreliable automatic context condensing on the VS Code LM (vscode-lm) provider.