Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/actions/src/prepare-request-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,17 @@ export async function prepareRequestBody(
// `reasoning` field back to provider-style `reasoning_content`. DeepSeek
// accepts an empty string, but Moonshot's newer reasoning models (kimi-k2.5,
// kimi-k2.6) treat an empty string as missing — use a single space as a
// non-empty placeholder there.
if (usedProvider === "deepseek" || usedProvider === "moonshot") {
const fallback = usedProvider === "moonshot" ? " " : "";
// non-empty placeholder there. Novita proxies DeepSeek V4 with the same
// upstream constraint, so apply the DeepSeek behavior there too.
const isNovitaDeepseekV4 =
Comment on lines +960 to +962

Copilot AI Apr 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline comment says to "apply the DeepSeek behavior" for Novita, but the code uses the Moonshot-style single-space placeholder (because empty string is treated as missing). Consider rewording to explicitly say you're applying the DeepSeek V4 tool_calls/reasoning_content workaround to Novita, and that Novita requires the non-empty placeholder.

Copilot uses AI. Check for mistakes.
usedProvider === "novita" && usedModel.startsWith("deepseek/deepseek-v4");
if (
usedProvider === "deepseek" ||
usedProvider === "moonshot" ||
isNovitaDeepseekV4
) {
const fallback =
usedProvider === "moonshot" || isNovitaDeepseekV4 ? " " : "";
processedMessages = processedMessages.map((m) => {
if (
m.role !== "assistant" ||
Expand Down
15 changes: 15 additions & 0 deletions packages/models/src/models/deepseek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,21 @@ export const deepseekModels = [
"tools",
],
},
{
providerId: "novita",
modelName: "deepseek/deepseek-v4-flash",
inputPrice: 0.14 / 1e6,
cachedInputPrice: 0.028 / 1e6,
outputPrice: 0.28 / 1e6,
requestPrice: 0,
contextSize: 1050000,
maxOutput: 393216,
streaming: true,
reasoning: true,
vision: false,
tools: true,
jsonOutput: true,
},
],
},
] as const satisfies ModelDefinition[];
Loading