feat(model-routing): enable dynamic routing by default (#3120)

* feat(model-routing): enable dynamic routing by default

Change defaultRoutingConfig().enabled from false to true so that
dynamic model routing (tier-based downgrading for light/standard
tasks) is active out of the box. Users can still disable it via
dynamic_routing.enabled: false in PREFERENCES.md.

This is a behavioral change: sessions that previously used the
configured model for all tasks will now automatically downgrade
to cheaper models for light and standard complexity tasks.

* test(model-routing): verify dynamic routing enabled by default

Tests that defaultRoutingConfig returns enabled: true and all
routing features are active.
This commit is contained in:
Jeremy McSpadden 2026-03-31 12:47:38 -05:00 committed by GitHub
parent 081c5dc52f
commit 17471ea280
2 changed files with 21 additions and 1 deletions

View file

@ -225,7 +225,7 @@ export function escalateTier(currentTier: ComplexityTier): ComplexityTier | null
*/
export function defaultRoutingConfig(): DynamicRoutingConfig {
return {
enabled: false,
enabled: true,
escalate_on_failure: true,
budget_pressure: true,
cross_provider: true,

View file

@ -0,0 +1,20 @@
/**
* Dynamic routing default verifies routing is enabled by default.
*/
import test from "node:test";
import assert from "node:assert/strict";
import { defaultRoutingConfig } from "../model-router.js";
test("defaultRoutingConfig returns enabled: true", () => {
const config = defaultRoutingConfig();
assert.equal(config.enabled, true, "dynamic routing should be enabled by default");
});
test("defaultRoutingConfig enables all routing features", () => {
const config = defaultRoutingConfig();
assert.equal(config.escalate_on_failure, true);
assert.equal(config.budget_pressure, true);
assert.equal(config.cross_provider, true);
assert.equal(config.hooks, true);
});