Roo-Code/packages
Roo Code 6e090e7112 feat: add heuristic-based model routing for cost optimization
Adds an experimental feature that dynamically routes API calls to a
lighter/cheaper model when the task is in an information-gathering phase.

Addresses Issue #11269 - Choose Model Dynamically Based on Request.

## How it works

- New experiment flag: modelRouting (disabled by default)
- New setting: modelRoutingLightModelId - the cheaper model ID to use
- ModelRouter tracks tool usage per API turn
- If previous turn only used "read" group tools (read_file, list_files,
  search_files, codebase_search), the next API call uses the light model
- Edit, command, browser, and MCP tools always use the primary model
- First turn always uses the primary model

## Changes

- packages/types/src/experiment.ts: Add modelRouting experiment ID
- packages/types/src/global-settings.ts: Add modelRoutingLightModelId
- src/shared/experiments.ts: Add MODEL_ROUTING config
- src/core/task/ModelRouter.ts: New heuristic-based model router
- src/core/task/Task.ts: Integrate ModelRouter into task lifecycle
- src/core/task/__tests__/ModelRouter.spec.ts: 35 tests (all passing)
2026-02-06 20:29:26 +00:00
..
build Custom tool calling (#10083) 2025-12-21 12:43:06 -08:00
cloud refactor(read_file): Codex-inspired read_file refactor EXT-617 (#10981) 2026-01-29 15:16:32 -07:00
config-eslint Upgrade to ESLint 9 + share eslint config across workspaces (#3815) 2025-05-21 21:30:21 -07:00
config-typescript Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
core feat(cli): improve dev experience and roo provider API key support (#11203) 2026-02-04 16:17:29 -08:00
evals IPC fixes for task cancellation and queued messages (#11162) 2026-02-02 11:13:56 -08:00
ipc Better IPC error logging (#9727) 2025-12-01 15:02:34 -08:00
telemetry fix(condense): remove custom condensing model option (#10901) 2026-01-22 20:06:04 -05:00
types feat: add heuristic-based model routing for cost optimization 2026-02-06 20:29:26 +00:00
vscode-shim Some cleanup in ExtensionHost (#10600) 2026-01-10 02:29:33 -08:00