-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Refactor: Unified context-management architecture with improved UX #9795
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
Re-review for commit 51aeabc is complete; context-management threshold handling is now centralized and covered by tests, with no net new issues identified in this update.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
ce8f7e4 to
4384ed0
Compare
- Consolidate all context-management UI into single module - Add type-safe exhaustiveness checking with assertNever - Make in-progress indicators visible for both automatic and forced context management - Add UI for sliding window truncation (previously silent) - Improve test coverage with comprehensive component tests - Use consistent codicon-fold icon across all context management events - Fix translation key references to use proper namespaced keys - Remove unused code and improve error handling
- Consolidate contextCondense and contextManagement into unified structure
- Move shared 'tokens' key to top-level contextManagement
- Rename 'condensing' to 'inProgress' for consistency with truncation
- Update all component references to use new translation keys
- Update test mocks with new translation structure
Benefits:
- Clear hierarchical structure: contextManagement > {condensation, truncation}
- Consistent naming: both operations have 'inProgress' state
- Eliminates cross-section references (truncation using condense keys)
- Easier to extend with new context management strategies
- Update all 17 language files to use new unified structure - Move from split contextCondense/contextManagement to single contextManagement - Apply consistent naming: condensation.inProgress and truncation.inProgress - All languages now follow same hierarchical structure - Verified with find-missing-translations.js: all complete Languages updated: ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW
This file is marked as deprecated and has been fully replaced by the new unified context-management module. Removing it resolves the knip check failure.
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Updated PR description to match the actual code implementation. Key changes:
|
Overview
This PR adds UI visibility for context management events (condensation and truncation) that were previously hidden from users.
Changes
User-Facing Impact
In-Progress Indicator for Context Management
Sliding Window Truncation Visibility
UI Consistency
FoldVerticalicon from lucide-react for visual consistency with condense buttonBackend Coordination
Task.tssignals context management lifecycle:condenseTaskContextStarted→ Enables in-progress UImanageContext()runs (condensation or truncation)condenseTaskContextResponse→ Clears in-progress stateNew
willManageContext()helper centralizes threshold logic to avoid duplication between Task.ts and manageContext().Architecture
Context management events handled directly in
ChatRow.tsxswitch cases with focused child components:InProgressRow- Shows spinner during context operationsCondensationResultRow- Shows condensation summary with token reduction and expandable summaryCondensationErrorRow- Shows error when condensation failsTruncationResultRow- Shows truncation details with messages removed countType System
New
packages/types/src/context-management.ts:CONTEXT_MANAGEMENT_EVENTSarray of event typesContextManagementEventunion typeisContextManagementEvent()type guard for runtime checkingExtended
ContextTruncationtype withnewContextTokensfield.Test Coverage
packages/types/src/__tests__/context-management.test.tswillManageContext()insrc/core/context-management/__tests__/ChatView.spec.tsx