Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/core/config/__tests__/routerRemoval.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { retiredProviderIdentifiers } from "@roo-code/types"

import { downgradeLegacyRooConfig, isLegacyRooConfig, LEGACY_ROO_PROVIDER } from "../routerRemoval"

describe("routerRemoval", () => {
it("uses the canonical retired Roo provider identifier without changing its persisted value", () => {
expect(LEGACY_ROO_PROVIDER).toBe(retiredProviderIdentifiers.roo)
expect(LEGACY_ROO_PROVIDER).toBe("roo")
})

it("continues to recognize and downgrade persisted Roo provider settings", () => {
const persistedConfig = {
apiProvider: retiredProviderIdentifiers.roo,
apiModelId: "roo/code-supernova",
rooApiKey: "legacy-key",
customSetting: "preserved",
}

expect(isLegacyRooConfig(persistedConfig)).toBe(true)
expect(downgradeLegacyRooConfig(persistedConfig)).toEqual({
config: { customSetting: "preserved" },
migrated: true,
})
})

it("leaves non-Roo retired provider settings unchanged", () => {
const persistedConfig = {
apiProvider: retiredProviderIdentifiers.groq,
apiModelId: "legacy-model",
}

expect(isLegacyRooConfig(persistedConfig)).toBe(false)
expect(downgradeLegacyRooConfig(persistedConfig)).toEqual({
config: persistedConfig,
migrated: false,
})
})
})
4 changes: 3 additions & 1 deletion src/core/config/routerRemoval.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { retiredProviderIdentifiers } from "@roo-code/types"

import { t } from "../../i18n"

export const LEGACY_ROO_PROVIDER = "roo"
export const LEGACY_ROO_PROVIDER = retiredProviderIdentifiers.roo

const ROUTER_REMOVAL_I18N_KEY = "common:errors.roo.routerRemoved"
const ROUTER_REMOVAL_DEFAULT_MESSAGE =
Expand Down
Loading