fix(qoder): allow qmodel_latest model key

- Add qmodel_latest to QODER_MODEL_MAP
- Expose qmodel_latest in static Qoder provider catalog (qd)
- Generalize executor comment so model set does not go stale
- Add unit coverage for the new model key + catalog

Closes #1638

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
therunnas
2026-06-06 10:44:37 +07:00
committed by decolua
co-authored by Cursor
parent e6c09aad15
commit 61d546627e
4 changed files with 20 additions and 3 deletions
+1
View File
@@ -153,6 +153,7 @@ export const PROVIDER_MODELS = {
{ id: "lite", name: "Qoder Lite" },
// Frontier models — pin a specific backing model
{ id: "qmodel", name: "Qwen 3.6 Plus (Qoder)" },
{ id: "qmodel_latest", name: "Qoder Qwen 3.7 Max" },
{ id: "dmodel", name: "DeepSeek V4 Pro (Qoder)" },
{ id: "dfmodel", name: "DeepSeek V4 Flash (Qoder)" },
{ id: "gm51model", name: "GLM 5.1 (Qoder)" },
+2 -2
View File
@@ -12,8 +12,8 @@
* - The request shape Qoder expects is non-trivial (chat_context with
* mirrored modelConfig, business block with stable IDs, system text
* hoisted out of the messages array). All ported from the reference.
* - Model identifier is one of the canonical 11 keys (auto / ultimate /
* performance / efficient / lite + 6 frontier "*model" ids); the
* - Model identifier is one of the canonical Qoder keys (auto / ultimate /
* performance / efficient / lite + frontier "*model" ids); the
* translator layer feeds us "qoder/<key>" so we strip the prefix.
* - Per-model `model_config` is fetched live from /algo/api/v2/model/list
* and cached. Sending the wrong block silently downgrades to a
+1
View File
@@ -46,6 +46,7 @@ export const QODER_MODEL_MAP = {
lite: "lite",
// Frontier models
qmodel: "qmodel",
qmodel_latest: "qmodel_latest",
dmodel: "dmodel",
dfmodel: "dfmodel",
gm51model: "gm51model",
+16 -1
View File
@@ -15,7 +15,12 @@ import crypto from "crypto";
import { qoderEncodeBody } from "../../src/lib/qoder/encoding.js";
import { buildCosyHeaders } from "../../src/lib/qoder/cosy.js";
import { QoderService } from "../../src/lib/oauth/services/qoder.js";
import { QODER_CHAT_URL_ENCODED, QODER_MODEL_LIST_URL } from "../../src/lib/qoder/constants.js";
import {
QODER_CHAT_URL_ENCODED,
QODER_MODEL_LIST_URL,
QODER_MODEL_MAP,
} from "../../src/lib/qoder/constants.js";
import { PROVIDER_MODELS } from "../../open-sse/config/providerModels.js";
import { __test__ as qoderExecutorInternals } from "../../open-sse/executors/qoder.js";
// Convenience aliases — tests were originally written against module-level
@@ -25,6 +30,16 @@ const generatePkcePair = () => new QoderService().generatePkcePair();
const initiateDeviceFlow = () => new QoderService().initiateDeviceFlow();
const parseExpiry = QoderService.parseExpiry;
describe("QODER_MODEL_MAP", () => {
it("allows Qoder's latest model key", () => {
expect(QODER_MODEL_MAP.qmodel_latest).toBe("qmodel_latest");
});
it("exposes Qoder's latest model in the static provider catalog", () => {
expect(PROVIDER_MODELS.qd.some((model) => model.id === "qmodel_latest")).toBe(true);
});
});
describe("qoderEncodeBody", () => {
it("preserves base64 length (input length divisible by 3)", () => {
const input = Buffer.from("abcdef", "utf8"); // 6 bytes → 8 base64 chars