fix: use DEFAULT_FLAGS.model as single source of truth for default model ID

This commit is contained in:
Roo Code 2026-01-12 02:48:59 +00:00
parent 510cf8fc8a
commit 1991eb6517
2 changed files with 9 additions and 10 deletions

View file

@ -134,11 +134,7 @@ describe("ModelService", () => {
const result = await service.fetchAvailableModels()
// Should include default model first with actual model name
expect(result[0]).toEqual({
modelId: "anthropic/claude-sonnet-4.5",
name: "Claude Sonnet 4.5",
description: "Best balance of speed and capability",
})
expect(result[0]).toEqual(DEFAULT_MODELS[0])
// Should include transformed models
expect(result.length).toBeGreaterThan(1)

View file

@ -6,6 +6,8 @@
import type * as acp from "@agentclientprotocol/sdk"
import { DEFAULT_FLAGS } from "@/types/constants.js"
// =============================================================================
// Model Types
// =============================================================================
@ -53,18 +55,19 @@ export interface ExtendedNewSessionResponse extends acp.NewSessionResponse {
/**
* Default models available when API is not accessible.
* These map to Roo Code Cloud model tiers.
* The first model uses DEFAULT_FLAGS.model as the source of truth.
*/
export const DEFAULT_MODELS: AcpModel[] = [
{
modelId: DEFAULT_FLAGS.model,
name: "Claude Sonnet 4.5",
description: "Best balance of speed and capability",
},
{
modelId: "anthropic/claude-opus-4.5",
name: "Claude Opus 4.5",
description: "Most capable for complex work",
},
{
modelId: "anthropic/claude-sonnet-4.5",
name: "Claude Sonnet 4.5",
description: "Best balance of speed and capability",
},
{
modelId: "anthropic/claude-haiku-4.5",
name: "Claude Haiku 4.5",