Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 3, 2025

Overview

image image image

This PR adds UI visibility for context management events (condensation and truncation) that were previously hidden from users.

Changes

User-Facing Impact

  1. In-Progress Indicator for Context Management

    • Before: Hidden - users were unaware condensation/truncation was occurring
    • After: In-progress spinner appears when context management begins
  2. Sliding Window Truncation Visibility

    • Before: No UI at all - system silently dropped messages
    • After: Truncation notification appears in chat with token counts (before → after)
  3. UI Consistency

    • Uses FoldVertical icon from lucide-react for visual consistency with condense button

Backend Coordination

Task.ts signals context management lifecycle:

  • condenseTaskContextStarted → Enables in-progress UI
  • manageContext() runs (condensation or truncation)
  • condenseTaskContextResponse → Clears in-progress state

New willManageContext() helper centralizes threshold logic to avoid duplication between Task.ts and manageContext().

Architecture

Context management events handled directly in ChatRow.tsx switch cases with focused child components:

  • InProgressRow - Shows spinner during context operations
  • CondensationResultRow - Shows condensation summary with token reduction and expandable summary
  • CondensationErrorRow - Shows error when condensation fails
  • TruncationResultRow - Shows truncation details with messages removed count

Type System

New packages/types/src/context-management.ts:

  • CONTEXT_MANAGEMENT_EVENTS array of event types
  • ContextManagementEvent union type
  • isContextManagementEvent() type guard for runtime checking

Extended ContextTruncation type with newContextTokens field.

Test Coverage

  • Type system tests in packages/types/src/__tests__/context-management.test.ts
  • Backend tests for willManageContext() in src/core/context-management/__tests__/
  • Frontend integration tests in ChatView.spec.tsx
  • Translations updated across all 18 language files

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. UI/UX UI/UX related or focused labels Dec 3, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 3, 2025

Oroocle Clock   See task on Roo Cloud

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.

  • Re-review latest context management architecture and ChatView UI changes
  • Verify non-destructive truncation and rewind behavior across backend and webview
  • Confirm updated Cloud/Extension/Provider marketing pages and navigation structure
  • Monitor for any regressions in context management events after release
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 3, 2025
@hannesrudolph hannesrudolph force-pushed the feature/unified-context-management branch from ce8f7e4 to 4384ed0 Compare December 4, 2025 21:44
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 5, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Review] in Roo Code Roadmap Dec 6, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Dec 6, 2025
hannesrudolph and others added 6 commits December 7, 2025 11:58
- 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>
@roomote
Copy link
Contributor

roomote bot commented Dec 7, 2025

Fixaroo Clock   See task on Roo Cloud

Updated PR description to match the actual code implementation. Key changes:

  • Removed outdated references to ContextManagementRow wrapper (was simplified away)
  • Updated architecture section to reflect direct handling in ChatRow.tsx with focused child components
  • Added willManageContext() helper to backend coordination section
  • Corrected icon reference to FoldVertical from lucide-react
  • Clarified test coverage locations

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 7, 2025
@mrubens mrubens merged commit 8aa1346 into main Dec 7, 2025
13 checks passed
@mrubens mrubens deleted the feature/unified-context-management branch December 7, 2025 22:43
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Dec 7, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer PR - Needs Review size:XL This PR changes 500-999 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants