feat: 升级至 v0.3.16 — 工单修复 51 项 + 审查修复 30 项(安全加固/适配器/工具系统/数据层/前端)

This commit is contained in:
2026-07-22 10:31:13 +08:00
parent 516d8a728f
commit 2c2ca4a692
43 changed files with 1454 additions and 301 deletions
@@ -46,6 +46,11 @@ export function buildOpenAICompatibleMessages(
content: m.content,
};
// 注意:图片(多模态)处理不在此共享函数中。
// DeepSeek 不支持多模态,images 被静默丢弃是正确行为。
// Agnes/MiMo 各自的 toNativeRequest 中有独立的 images 处理。
// 审查修复: #27 曾在此添加 images 处理,但 DeepSeek 不支持多模态会导致 API 400,已撤销。
// === Assistant 消息 ===
if (m.role === 'assistant') {
// 工具调用历史
@@ -74,6 +79,10 @@ export function buildOpenAICompatibleMessages(
: (typeof m.toolResult.result === 'string'
? m.toolResult.result
: JSON.stringify(m.toolResult.result));
// #26 修复: 确保 tool 消息 content 不为 undefined
// JSON.stringify(undefined) 返回 undefined(非字符串),会导致 content 字段在序列化后消失
// OpenAI/DeepSeek/Agnes API 严格要求 tool 消息必须有 content 字段,缺失会返回 400
if (msg.content === undefined) msg.content = '';
}
return msg;