Skip to content

feat: restore dedicated model selector for context condensing#11988

Draft
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/restore-condensing-model-selector
Draft

feat: restore dedicated model selector for context condensing#11988
roomote-v0[bot] wants to merge 1 commit intomainfrom
feature/restore-condensing-model-selector

Conversation

@roomote-v0
Copy link
Copy Markdown
Contributor

@roomote-v0 roomote-v0 bot commented Mar 25, 2026

Related GitHub Issue

Closes: #11785

Description

This PR attempts to address Issue #11785 by restoring the dedicated model selector for context condensing. Feedback and guidance are welcome.

Problem: The option to select a dedicated model for context condensing was removed in PR #10901. Users who rely on expensive models (e.g., Claude Opus) for coding had no way to use a cheaper model (e.g., Gemini Flash) for condensing, leading to high costs or broken workflows when manually switching models.

Solution: Adds a condensingApiConfigId setting that allows users to select a dedicated API configuration for condensing operations. Key implementation details:

  • Types: Added condensingApiConfigId to GlobalSettings schema and ExtensionState
  • Backend: Task.ts gains a buildCondensingApiHandler() method that creates a separate API handler when a dedicated config is set, falling back to the task's main handler otherwise. This handler is used in all three condensing call sites (manual condense, auto condense in attemptApiRequest, and context window exceeded recovery)
  • Frontend: Added an API configuration dropdown in the Context Management settings section. Translation keys already existed in all locales from the previous implementation
  • Message handler: Added condensingApiConfigId webview message handler (same pattern as enhancementApiConfigId)

The existing transformMessagesForCondensing() safeguard that converts tool blocks to text before sending to the condensing API is preserved, which handles cross-provider compatibility concerns.

Test Procedure

  • All 26 ContextManagementSettings tests pass (updated combobox counts for the new dropdown)
  • All 67 condense/index tests pass
  • All 58 context-management tests pass
  • Full lint and type-check passed across all 14 packages

To manually test:

  1. Open Roo Code settings -> Context Management
  2. Verify the new "API Configuration for Context Condensing" dropdown appears
  3. Select a cheaper model profile (e.g., Gemini Flash)
  4. Start a conversation with an expensive model, trigger condense
  5. Verify condensing uses the selected cheaper model

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue
  • Scope: Changes are focused on the linked issue
  • Self-Review: I have performed a thorough self-review of my code
  • Testing: Updated tests to cover new props and UI elements
  • Documentation Impact: No documentation updates needed (translation keys already existed)
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines

Interactively review PR in Roo Code Cloud

Adds a condensingApiConfigId setting that allows users to select a
dedicated API configuration for context condensing operations. This
restores the ability to use a cheaper/faster model (e.g. Gemini Flash)
for condensing while keeping an expensive model (e.g. Claude Opus) as
the active coding model.

Changes:
- Add condensingApiConfigId to global settings schema and ExtensionState
- Add webview message handler for condensingApiConfigId
- Build dedicated API handler in Task.ts for manual and auto condensing
- Add API config dropdown in ContextManagementSettings UI
- Update tests for new combobox count and default props

Closes #11785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Context Condensing Regression: No dedicated model selector, using active model causes high cost/errors, and switching models breaks continuation

1 participant