merge: resolve conflicts with origin/master - keep both local and remote features

This commit is contained in:
2026-06-22 11:40:16 +07:00
424 changed files with 24520 additions and 11731 deletions

View File

@@ -20,19 +20,20 @@
* different model upstream, so a missing entry is a hard error.
*/
import { qoderEncodeBody } from "@/lib/qoder/encoding.js";
import { buildCosyHeaders } from "@/lib/qoder/cosy.js";
import { qoderEncodeBody } from "../shared/qoder/encoding.js";
import { buildCosyHeaders } from "../shared/qoder/cosy.js";
import { v4 as uuidv4 } from "uuid";
import { createHash } from "crypto";
import { BaseExecutor } from "./base.js";
import { PROVIDERS } from "../config/providers.js";
import { proxyAwareFetch } from "../utils/proxyFetch.js";
import { SSE_DONE } from "../utils/sseConstants.js";
import { FETCH_CONNECT_TIMEOUT_MS } from "../config/runtimeConfig.js";
import {
QODER_CHAT_URL_ENCODED,
QODER_MODEL_MAP,
} from "@/lib/qoder/constants.js";
} from "../shared/qoder/constants.js";
import { getQoderModelConfig, resolveQoderModels } from "../services/qoderModels.js";
/**
@@ -356,7 +357,7 @@ async function wrapQoderSSE(response, model, midStreamError = {}) {
const data = trimmed.slice(5).trimStart();
if (data === "[DONE]") {
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
controller.enqueue(encoder.encode(SSE_DONE));
doneEmitted = true;
return;
}
@@ -377,13 +378,13 @@ async function wrapQoderSSE(response, model, midStreamError = {}) {
choices: [{ index: 0, delta: { content: `\n\n${parsed.message}` }, finish_reason: "stop" }],
});
controller.enqueue(encoder.encode(`data: ${errChunk}\n\n`));
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
controller.enqueue(encoder.encode(SSE_DONE));
doneEmitted = true;
return;
}
if (!inner) return;
if (inner === "[DONE]") {
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
controller.enqueue(encoder.encode(SSE_DONE));
doneEmitted = true;
return;
}
@@ -408,7 +409,7 @@ async function wrapQoderSSE(response, model, midStreamError = {}) {
buffer = "";
}
if (!doneEmitted) {
controller.enqueue(encoder.encode("data: [DONE]\n\n"));
controller.enqueue(encoder.encode(SSE_DONE));
doneEmitted = true;
}
},