feat: set horizon-beta model max tokens to 32k for OpenRouter (#6577)

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-08-01 21:11:24 -04:00 committed by GitHub
parent 69685c779d
commit 19c157e51c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View file

@ -276,6 +276,29 @@ describe("OpenRouter API", () => {
expect(result.contextWindow).toBe(128000)
})
it("sets horizon-beta model to 32k max tokens", () => {
const mockModel = {
name: "Horizon Beta",
description: "Test model",
context_length: 128000,
max_completion_tokens: 128000,
pricing: {
prompt: "0.000003",
completion: "0.000015",
},
}
const result = parseOpenRouterModel({
id: "openrouter/horizon-beta",
model: mockModel,
modality: "text",
maxTokens: 128000,
})
expect(result.maxTokens).toBe(32768)
expect(result.contextWindow).toBe(128000)
})
it("does not override max tokens for other models", () => {
const mockModel = {
name: "Other Model",

View file

@ -237,5 +237,10 @@ export const parseOpenRouterModel = ({
modelInfo.maxTokens = 32768
}
// Set horizon-beta model to 32k max tokens
if (id === "openrouter/horizon-beta") {
modelInfo.maxTokens = 32768
}
return modelInfo
}