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:
@@ -153,6 +153,7 @@ export const PROVIDER_MODELS = {
|
|||||||
{ id: "lite", name: "Qoder Lite" },
|
{ id: "lite", name: "Qoder Lite" },
|
||||||
// Frontier models — pin a specific backing model
|
// Frontier models — pin a specific backing model
|
||||||
{ id: "qmodel", name: "Qwen 3.6 Plus (Qoder)" },
|
{ 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: "dmodel", name: "DeepSeek V4 Pro (Qoder)" },
|
||||||
{ id: "dfmodel", name: "DeepSeek V4 Flash (Qoder)" },
|
{ id: "dfmodel", name: "DeepSeek V4 Flash (Qoder)" },
|
||||||
{ id: "gm51model", name: "GLM 5.1 (Qoder)" },
|
{ id: "gm51model", name: "GLM 5.1 (Qoder)" },
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
* - The request shape Qoder expects is non-trivial (chat_context with
|
* - The request shape Qoder expects is non-trivial (chat_context with
|
||||||
* mirrored modelConfig, business block with stable IDs, system text
|
* mirrored modelConfig, business block with stable IDs, system text
|
||||||
* hoisted out of the messages array). All ported from the reference.
|
* hoisted out of the messages array). All ported from the reference.
|
||||||
* - Model identifier is one of the canonical 11 keys (auto / ultimate /
|
* - Model identifier is one of the canonical Qoder keys (auto / ultimate /
|
||||||
* performance / efficient / lite + 6 frontier "*model" ids); the
|
* performance / efficient / lite + frontier "*model" ids); the
|
||||||
* translator layer feeds us "qoder/<key>" so we strip the prefix.
|
* translator layer feeds us "qoder/<key>" so we strip the prefix.
|
||||||
* - Per-model `model_config` is fetched live from /algo/api/v2/model/list
|
* - Per-model `model_config` is fetched live from /algo/api/v2/model/list
|
||||||
* and cached. Sending the wrong block silently downgrades to a
|
* and cached. Sending the wrong block silently downgrades to a
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export const QODER_MODEL_MAP = {
|
|||||||
lite: "lite",
|
lite: "lite",
|
||||||
// Frontier models
|
// Frontier models
|
||||||
qmodel: "qmodel",
|
qmodel: "qmodel",
|
||||||
|
qmodel_latest: "qmodel_latest",
|
||||||
dmodel: "dmodel",
|
dmodel: "dmodel",
|
||||||
dfmodel: "dfmodel",
|
dfmodel: "dfmodel",
|
||||||
gm51model: "gm51model",
|
gm51model: "gm51model",
|
||||||
|
|||||||
@@ -15,7 +15,12 @@ import crypto from "crypto";
|
|||||||
import { qoderEncodeBody } from "../../src/lib/qoder/encoding.js";
|
import { qoderEncodeBody } from "../../src/lib/qoder/encoding.js";
|
||||||
import { buildCosyHeaders } from "../../src/lib/qoder/cosy.js";
|
import { buildCosyHeaders } from "../../src/lib/qoder/cosy.js";
|
||||||
import { QoderService } from "../../src/lib/oauth/services/qoder.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";
|
import { __test__ as qoderExecutorInternals } from "../../open-sse/executors/qoder.js";
|
||||||
|
|
||||||
// Convenience aliases — tests were originally written against module-level
|
// Convenience aliases — tests were originally written against module-level
|
||||||
@@ -25,6 +30,16 @@ const generatePkcePair = () => new QoderService().generatePkcePair();
|
|||||||
const initiateDeviceFlow = () => new QoderService().initiateDeviceFlow();
|
const initiateDeviceFlow = () => new QoderService().initiateDeviceFlow();
|
||||||
const parseExpiry = QoderService.parseExpiry;
|
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", () => {
|
describe("qoderEncodeBody", () => {
|
||||||
it("preserves base64 length (input length divisible by 3)", () => {
|
it("preserves base64 length (input length divisible by 3)", () => {
|
||||||
const input = Buffer.from("abcdef", "utf8"); // 6 bytes → 8 base64 chars
|
const input = Buffer.from("abcdef", "utf8"); // 6 bytes → 8 base64 chars
|
||||||
|
|||||||
Reference in New Issue
Block a user