Skip to content
Merged
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
37 changes: 37 additions & 0 deletions packages/types/src/__tests__/vscode-llm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@ describe("vscodeLlmModels", () => {
expect(vscodeLlmModels["gemini-2.5-pro"].contextWindow).toBe(108594)
expect(vscodeLlmModels["gemini-2.5-pro"].maxInputTokens).toBe(108594)
})
it.each([
["claude-opus-5", "Claude Opus 5", 935793, "advertised, unverified"],
["claude-sonnet-5", "Claude Sonnet 5", 925449, "measured"],
["gpt-5.6-luna", "GPT-5.6 Luna", 199753, "measured"],
["gpt-5.6-sol", "GPT-5.6 Sol", 271785, "measured"],
["gpt-5.6-terra", "GPT-5.6 Terra", 271785, "measured"],
["gemini-3.6-flash", "Gemini 3.6 Flash", 935793, "advertised, unverified"],
] as const)("preserves PR #13 row %s (%s), limit %i (%s)", (...[family, name, limit]) => {
expect(vscodeLlmModels[family]).toEqual({
contextWindow: limit,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family,
version: family,
name,
supportsToolCalling: true,
maxInputTokens: limit,
})
})

it.each([
["claude-opus-5", "claude-opus-4.8"],
["claude-sonnet-5", "claude-sonnet-4.6"],
["gpt-5.6-luna", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.5"],
["gemini-3.6-flash", "gemini-3.1-pro-preview"],
])("preserves upstream ordering starting with %s", (...families) => {
const modelIds = Object.keys(vscodeLlmModels)
const startIndex = modelIds.indexOf(families[0])
expect(startIndex).toBeGreaterThanOrEqual(0)
expect(modelIds.slice(startIndex, startIndex + families.length)).toEqual(families)
})

it("keeps both window fields populated and positive for every row", () => {
for (const [family, model] of Object.entries(vscodeLlmModels)) {
expect(model.contextWindow, `${family}: contextWindow must be a positive integer`).toBeGreaterThan(0)
Expand All @@ -25,6 +59,9 @@ describe("vscodeLlmModels", () => {
expect(vscodeLlmModels).not.toHaveProperty("claude-opus-4.7-high")
expect(vscodeLlmModels).not.toHaveProperty("claude-3.5-sonnet")
expect(vscodeLlmModels).not.toHaveProperty("claude-4-sonnet")
expect(vscodeLlmModels).not.toHaveProperty("auto")
expect(vscodeLlmModels).not.toHaveProperty("copilot-utility")
expect(vscodeLlmModels).not.toHaveProperty("copilot-utility-small")
})
it("defaults to a model id that exists in the table", () => {
expect(vscodeLlmDefaultModelId).toBe("claude-sonnet-4.5")
Expand Down
75 changes: 75 additions & 0 deletions packages/types/src/providers/vscode-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,22 @@ export const vscodeLlmDefaultModelId: VscodeLlmModelId = "claude-sonnet-4.5"
// Curated VS Code LM (GitHub Copilot) model catalog.
// The API exposes only `maxInputTokens`; the UI and condense gate read that. `contextWindow` is
// the advertised window, kept for rows where it diverges from the ceiling (e.g. claude-opus-4.8).
// https://github.com/simurg79/Roo-Code/pull/13: sonnet-5 and gpt-5.6 limits were measured
// by single-message binary search on VS Code 1.126.0 (2026-07-14). Opus-5 and gemini-3.6-flash
// retain advertised, unverified limits from the Copilot model-picker cache (2026-07-26).
export const vscodeLlmModels = {
"claude-opus-5": {
contextWindow: 935793,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "claude-opus-5",
version: "claude-opus-5",
name: "Claude Opus 5",
supportsToolCalling: true,
maxInputTokens: 935793,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maxInputTokens here (and for gemini-3.6-flash at line 250) comes from the advertised picker cache and is marked unverified in the header. Since the condense gate reads this field, would a too-high ceiling mean we never condense before the API rejects the request? Is it worth verifying these two with the same binary search used for sonnet-5 and gpt-5.6, or keeping them lower until measured?

},
"claude-opus-4.8": {
contextWindow: 679560,
supportsImages: true,
Expand Down Expand Up @@ -66,6 +81,18 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 167790,
},
"claude-sonnet-5": {
contextWindow: 925449,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "claude-sonnet-5",
version: "claude-sonnet-5",
name: "Claude Sonnet 5",
supportsToolCalling: true,
maxInputTokens: 925449,
},
"claude-sonnet-4.6": {
contextWindow: 197896,
supportsImages: true,
Expand Down Expand Up @@ -102,6 +129,42 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 135790,
},
"gpt-5.6-luna": {
contextWindow: 199753,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "gpt-5.6-luna",
version: "gpt-5.6-luna",
name: "GPT-5.6 Luna",
supportsToolCalling: true,
maxInputTokens: 199753,
},
"gpt-5.6-sol": {
contextWindow: 271785,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "gpt-5.6-sol",
version: "gpt-5.6-sol",
name: "GPT-5.6 Sol",
supportsToolCalling: true,
maxInputTokens: 271785,
},
"gpt-5.6-terra": {
contextWindow: 271785,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "gpt-5.6-terra",
version: "gpt-5.6-terra",
name: "GPT-5.6 Terra",
supportsToolCalling: true,
maxInputTokens: 271785,
},
"gpt-5.5": {
contextWindow: 268426,
supportsImages: true,
Expand Down Expand Up @@ -174,6 +237,18 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 12078,
},
"gemini-3.6-flash": {
contextWindow: 935793,
supportsImages: true,
supportsPromptCache: false,
inputPrice: 0,
outputPrice: 0,
family: "gemini-3.6-flash",
version: "gemini-3.6-flash",
name: "Gemini 3.6 Flash",
supportsToolCalling: true,
maxInputTokens: 935793,
},
"gemini-3.1-pro-preview": {
contextWindow: 197897,
supportsImages: true,
Expand Down
Loading