feat(qoder): fetch latest model + nút import model trên dashboard

Merge PR #1642 (decolua/9router) — chỉ lấy code + i18n, bỏ test/docs/package.json.

- qoder.js: bỏ guard QODER_MODEL_MAP cứng, resolve model_config qua dynamic API (hỗ trợ qmodel_latest không cần sửa code)
- dashboard page: thêm nút "Fetch Qoder Models" tự import model list vào aliases
- i18n zh-CN: thêm key cho nút fetch

Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zhangweihong
2026-06-06 10:22:03 +07:00
committed by decolua
co-authored by Claude Cursor
parent 44d8de288d
commit 12c97ad46f
3 changed files with 83 additions and 4 deletions
+4 -4
View File
@@ -125,10 +125,9 @@ function truncate(s, n) {
*/
async function buildQoderRequestBody({ model, body, credentials, log, proxyOptions, signal }) {
const qoderKey = String(model || "").replace(/^qoder\//, "");
if (!QODER_MODEL_MAP[qoderKey]) {
throw new Error(`Unsupported qoder model: "${qoderKey}" (received "${model}")`);
}
// Fetch model config from dynamic API instead of relying on static QODER_MODEL_MAP.
// This allows support for new Qoder models (e.g., qmodel_latest) without code changes.
let modelConfig = await getQoderModelConfig(credentials, qoderKey, { log, proxyOptions, signal });
if (!modelConfig) {
// Try a forced refresh once before giving up — the cache may simply
@@ -447,4 +446,5 @@ export default QoderExecutor;
export const __test__ = {
normalizeMessages,
wrapQoderSSE,
buildQoderRequestBody,
};