-
Notifications
You must be signed in to change notification settings - Fork 2.8k
rename: sliding-window -> context-management; truncateConversationIfNeeded -> manageContext #9206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…and sliding-window shim - Canonical module: [src/core/context-management/index.ts](src/core/context-management/index.ts:1) - Canonical API: [manageContext()](src/core/context-management/index.ts:99) - Types: [ContextManagementOptions](src/core/context-management/index.ts:75), [ContextManagementResult](src/core/context-management/index.ts:91) - Removed shim: src/core/sliding-window - Telemetry unchanged: [SLIDING_WINDOW_TRUNCATION](packages/types/src/telemetry.ts:40) and [truncateConversation()](src/core/context-management/index.ts:54) emits event
Review completed. No issues found. This PR successfully renames the sliding-window module to context-management with updated API names while preserving all functionality. The refactoring is clean with proper import updates, consistent type definitions, and maintained test coverage. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
hannesrudolph
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found some issues that need attention:
P2: Update the misleading comment in Task.ts to match manageContext behavior (condense-first, truncate as fallback).
P2: Clamp allowedTokens to >= 0 in context-management/index.ts to avoid over-truncation when reservedTokens is large relative to a small contextWindow.
Context-management unit tests pass locally after the clamp.
* Add Intercom as a subprocessor (RooCodeInc#8718) * web: Leftover white bg (RooCodeInc#8719) Leftover white bg * feat(zgsm): add supportsMaxTokens flag and adjust max token handling * docs: update Configuring Profiles video link (RooCodeInc#8189) Co-authored-by: Roo Code <[email protected]> * Fix link text for Roomote Control in README (RooCodeInc#8742) * Try a 5s status mutation timeout (RooCodeInc#8734) * web: Landing page for the reviewerFirst pass (RooCodeInc#8740) * First pass * SEO * Update a
Problem
“Sliding window” was used to describe both a truncation algorithm and the broader feature that first tries to condense context, only truncating when necessary. This blurred terminology made the feature harder to understand for users and contributors, and hid how it actually works.
What changed (user-facing)
Benefits
Details (for maintainers)
Telemetry and compatibility
Release note
Context handling is clearer: the system condenses first and truncates only if needed, via a single API manageContext(). No changes required on your side; reliability and telemetry remain the same.
Maintainers
Repo requested a changeset:
pnpm changeset