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
5 changes: 5 additions & 0 deletions .changeset/ten-knives-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

fix: override context window for MiniMax/Kimi free models
6 changes: 6 additions & 0 deletions src/api/providers/fetchers/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,11 @@ export const parseOpenRouterModel = ({
modelInfo.maxTokens = 32768
}

// kilocode_change start
if (id.includes("minimax-2.1:free") || id.includes("kimi-2.5:free")) {

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.

WARNING: Missing test coverage for this new override.

Every other model-specific override in parseOpenRouterModel has a corresponding test in openrouter.spec.ts (e.g., horizon-alpha, horizon-beta, claude-sonnet-4.6). This new context window override for MiniMax/Kimi free models should also have test coverage.

Consider adding tests like:

it("overrides context window for minimax-2.1:free models", () => {
  const mockModel = {
    name: "MiniMax 2.1 Free",
    description: "Test model",
    context_length: 1000000,
    max_completion_tokens: 8192,
    pricing: { prompt: "0", completion: "0" },
  }

  const result = parseOpenRouterModel({
    id: "minimax/minimax-2.1:free",
    model: mockModel,
    inputModality: ["text"],
    outputModality: ["text"],
    maxTokens: 8192,
  })

  expect(result.contextWindow).toBe(200000)
})

And a similar test for kimi-2.5:free.

modelInfo.contextWindow = 200000
}
// kilocode_change end

return modelInfo
}
Loading