-
Notifications
You must be signed in to change notification settings - Fork 894
feat(cursor): ultra mode toggle (kimi-k3-1m) with Max Mode wire flag #2654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { | ||
| CURSOR_STATIC_MODELS, | ||
| CURSOR_ULTRA_1M_MODEL_IDS, | ||
| cursorUltraBaseModelId, | ||
| filterCursorConfiguredModelsByLiveDiscovery, | ||
| } from "../src/adapters/cursor/discovery"; | ||
| import { createCursorRequest } from "../src/adapters/cursor/request-builder"; | ||
| import { encodeCursorRunRequest } from "../src/adapters/cursor/protobuf-request"; | ||
| import { fromBinary } from "@bufbuild/protobuf"; | ||
| import { AgentClientMessageSchema, type AgentRunRequest } from "../src/adapters/cursor/gen/agent_pb"; | ||
| import type { OcxParsedRequest } from "../src/types/request"; | ||
|
|
||
| function decodeRunRequest(bytes: Uint8Array): AgentRunRequest { | ||
| const msg = fromBinary(AgentClientMessageSchema, bytes); | ||
| if (msg.message.case !== "runRequest") throw new Error("expected runRequest"); | ||
| return msg.message.value; | ||
| } | ||
|
|
||
| function parsedFor(modelId: string, reasoning?: string): OcxParsedRequest { | ||
| return { | ||
| modelId, | ||
| context: { systemPrompt: [], messages: [{ role: "user", content: "hi" }] }, | ||
| options: reasoning ? { reasoning } : {}, | ||
| } as OcxParsedRequest; | ||
| } | ||
|
|
||
| describe("cursor ultra (-1m / Max Mode) toggle (devlog 260826 070)", () => { | ||
| test("static catalog exposes the kimi-k3-1m picker row with 1M context", () => { | ||
| const row = CURSOR_STATIC_MODELS.find(model => model.id === "kimi-k3-1m"); | ||
| expect(row).toBeDefined(); | ||
| expect(row?.contextWindow).toBe(1_000_000); | ||
| expect(row?.supportsReasoningEffort).toBe(true); | ||
| }); | ||
|
|
||
| test("ultra marker resolves to its wire base and never leaks", () => { | ||
| expect(cursorUltraBaseModelId("cursor/kimi-k3-1m")).toBe("kimi-k3"); | ||
| expect(cursorUltraBaseModelId("kimi-k3-1m")).toBe("kimi-k3"); | ||
| expect(cursorUltraBaseModelId("kimi-k3")).toBeUndefined(); | ||
| expect(cursorUltraBaseModelId("claude-4-sonnet-1m")).toBeUndefined(); | ||
| }); | ||
|
|
||
| test("kimi-k3-1m + max resolves to wire kimi-k3-max with maxMode on the request", () => { | ||
| const request = createCursorRequest(parsedFor("cursor/kimi-k3-1m", "max")); | ||
| expect(request.modelId).toBe("kimi-k3-max"); | ||
| expect(request.maxMode).toBe(true); | ||
| }); | ||
|
|
||
| test("plain kimi-k3 stays maxMode-off", () => { | ||
| const request = createCursorRequest(parsedFor("cursor/kimi-k3", "max")); | ||
| expect(request.modelId).toBe("kimi-k3-max"); | ||
| expect(request.maxMode).toBeUndefined(); | ||
| }); | ||
|
|
||
| test("wire raises maxMode on BOTH RequestedModel and ModelDetails", () => { | ||
| const bytes = encodeCursorRunRequest({ | ||
| modelId: "kimi-k3-max", | ||
| maxMode: true, | ||
| conversationId: "c1", | ||
| system: [], | ||
| messages: [{ role: "user", content: "hi" }], | ||
| }); | ||
| const decoded = decodeRunRequest(bytes); | ||
| expect(decoded.requestedModel?.maxMode).toBe(true); | ||
| expect(decoded.requestedModel?.modelId).toBe("kimi-k3-max"); | ||
| expect(decoded.modelDetails?.maxMode).toBe(true); | ||
| }); | ||
|
|
||
| test("non-ultra requests keep maxMode=false wire behavior", () => { | ||
| const bytes = encodeCursorRunRequest({ | ||
| modelId: "kimi-k3-max", | ||
| conversationId: "c1", | ||
| system: [], | ||
| messages: [{ role: "user", content: "hi" }], | ||
| }); | ||
| const decoded = decodeRunRequest(bytes); | ||
| expect(decoded.requestedModel).toBeUndefined(); | ||
| // ModelDetails.maxMode is proto-optional; absent (undefined) means off. | ||
| expect(decoded.modelDetails?.maxMode ?? false).toBe(false); | ||
| }); | ||
|
|
||
| test("account filter admits the synthetic row through its base availability", () => { | ||
| const configured = [{ id: "kimi-k3-1m" }, { id: "kimi-k3" }]; | ||
| const live = ["kimi-k3-high", "kimi-k3-max"]; | ||
| const filtered = filterCursorConfiguredModelsByLiveDiscovery(configured, live); | ||
| expect(filtered.map(model => model.id)).toEqual(["kimi-k3-1m", "kimi-k3"]); | ||
| }); | ||
|
|
||
| test("ultra id set stays narrow and every entry has a static row", () => { | ||
| for (const id of CURSOR_ULTRA_1M_MODEL_IDS) { | ||
| expect(CURSOR_STATIC_MODELS.some(model => model.id === id)).toBe(true); | ||
| } | ||
| }); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding
cursor/kimi-k3-1mchanges the user-visible model catalog and introduces Max Mode behavior, butdocs-site/src/content/docs/guides/providers.md:585-592still describes only the 262Kcursor/kimi-k3row and its effort ladder; the translated provider guides likewise omit the new selection. Update the English guide and translations so users can distinguish the synthetic 1M row, its plan-gated behavior, and its wire mapping.AGENTS.md reference: src/AGENTS.md:L28-L28
Useful? React with 👍 / 👎.