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
77 changes: 76 additions & 1 deletion packages/types/src/__tests__/vscode-llm.spec.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions packages/types/src/providers/vscode-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,17 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 658785,
},
// User-authorized advertised budget, not measured; getVscodeLlmModelInfo restricts it to Copilot.
"claude-fable-5.2": {
contextWindow: 871793,
supportsImages: true,
supportsPromptCache: false,
family: "claude-fable-5.2",
version: "claude-fable-5.2",
name: "Claude Fable 5.2",
supportsToolCalling: true,
maxInputTokens: 871793,
},
Comment on lines +269 to +279

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.

FYI: This row uses the advertised 871793 as maxInputTokens, but the Fable 5, Fable 5.1, Sonnet 5.5, and Opus 5.5 rows stop between 658785 and 680552.

@simurg79 simurg79 Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I created a script that launces VS Code and checks for the context limit. VS Code itself puts a limit on the context, which is not advertised and it varies significantly. This was causing all kind of issues such as context going beyond the limit and Zoo was not able to condense the context.

I personally don't know what the actual values are. My script does binary search and locates the value while experimenting it under VS Code.

// Values copied from claude-fable-5.1 at the user's request; not measured for claude-fable-5.5.
"claude-fable-5.5": {
contextWindow: 935793,
Expand All @@ -277,6 +288,63 @@ export const vscodeLlmModels = {
supportsToolCalling: true,
maxInputTokens: 660686,
},
// Through gpt-6.2-sol: measured 2026-11-26, VS Code 1.147.0/copilot; maxInputTokens = largest
// accepted size, no margin. Prices and caching are unmeasured.
"gemini-4-neon": {
contextWindow: 982833,
supportsImages: true,
supportsPromptCache: false,
family: "gemini-4-neon",
version: "gemini-4-neon",
name: "Gemini 4 Neon",
supportsToolCalling: true,
// Lower bound; 901675 got a generic 400, cause unconfirmed.
maxInputTokens: 897718,
},
"gemini-4-hydrogen": {
contextWindow: 982830,
supportsImages: true,
supportsPromptCache: false,
family: "gemini-4-hydrogen",
version: "gemini-4-hydrogen",
name: "Gemini 4 Hydrogen",
supportsToolCalling: true,
// Lower bound; 901674 got a generic 400, cause unconfirmed.
maxInputTokens: 897719,
},
"gemini-4-carbon": {
contextWindow: 935793,
supportsImages: true,
supportsPromptCache: false,
family: "gemini-4-carbon",
version: "gemini-4-carbon",
name: "Gemini 4 Carbon",
supportsToolCalling: true,
// Lower bound; 903669 got a generic 400, cause unconfirmed.
maxInputTokens: 899900,
},
"gpt-6.2-astra": {
contextWindow: 921793,
supportsImages: true,
supportsPromptCache: false,
family: "gpt-6.2-astra",
version: "gpt-6.2-astra",
name: "GPT-6.2 Astra",
supportsToolCalling: true,
// Accepted 271119, rejected 274827 (exceeds); gpt-6-astra's 5K margin does not apply.
maxInputTokens: 271119,
},
"gpt-6.2-sol": {
contextWindow: 921793,
supportsImages: true,
supportsPromptCache: false,
family: "gpt-6.2-sol",
version: "gpt-6.2-sol",
name: "GPT-6.2 Sol",
supportsToolCalling: true,
// Accepted 271119, rejected 274826 (exceeds).
maxInputTokens: 271119,
},
"claude-sonnet-5": {
contextWindow: 925449,
supportsImages: true,
Expand Down Expand Up @@ -566,3 +634,12 @@ export const vscodeLlmModels = {
maxInputTokens: number
}
>

// Shared by the gauge and condensation; unknown families use the default budget, not a live window.
export function getVscodeLlmModelInfo(family: string | undefined, vendor: string | undefined) {
return family &&
Object.prototype.hasOwnProperty.call(vscodeLlmModels, family) &&
(family !== "claude-fable-5.2" || vendor === githubCopilotLanguageModel.vendor)
? vscodeLlmModels[family as VscodeLlmModelId]
: vscodeLlmModels[vscodeLlmDefaultModelId]
}
44 changes: 44 additions & 0 deletions src/api/providers/__tests__/github-copilot.spec.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions src/api/providers/__tests__/vscode-lm.spec.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/api/providers/vscode-lm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import {
type ModelInfo,
openAiModelInfoSaneDefaults,
providerIdentifiers,
vscodeLlmDefaultModelId,
vscodeLlmModels,
getVscodeLlmModelInfo,
} from "@roo-code/types"

import type { ApiHandlerOptions } from "../../shared/api"
Expand Down Expand Up @@ -1666,9 +1665,8 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
*/
getCondenseContextWindow(): number {
const family = this.client?.family ?? this.options.vsCodeLmModelSelector?.family
const staticModel = family
? (vscodeLlmModels[family as keyof typeof vscodeLlmModels] ?? vscodeLlmModels[vscodeLlmDefaultModelId])
: vscodeLlmModels[vscodeLlmDefaultModelId]
const vendor = this.client?.vendor ?? this.options.vsCodeLmModelSelector?.vendor
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
const staticModel = getVscodeLlmModelInfo(family, vendor)

if (staticModel && typeof staticModel.maxInputTokens === "number" && staticModel.maxInputTokens > 0) {
return staticModel.maxInputTokens
Expand Down
Loading
Loading