Merge remote-tracking branch 'origin/pr-587' into codex/pr-557-589-security-integration
# Conflicts: # backend/internal/app/cloud_agent_runtime.go
This commit is contained in:
commit
60cae78677
11 files changed
+1322
-7
No files matched your search
@@ -300,6 +300,18 @@ func providerPayloadErrorCategory(raw string) (string, bool) {
|
||||
return "输入素材疑似包含真人形象,该模型拒绝生成,请更换为非真人素材或改用其他模型", true
|
||||
case strings.Contains(normalized, "safety"), strings.Contains(normalized, "moderation"), strings.Contains(normalized, "content policy"), strings.Contains(normalized, "blocked"):
|
||||
return "请求内容未通过模型服务安全审核,请调整后重试", true
|
||||
// 工具调用与工具结果不配对:上游要求 assistant 消息声明的每一个 tool_call_id 都在
|
||||
// 紧随其后的 tool 消息里被回应。这是**我们组装请求**的问题——用户改提示词或查额度
|
||||
// 都没用——所以文案指向反馈而不是"调整输入"。
|
||||
//
|
||||
// 必须排在额度类目之前:DeepSeek 的原文含 "insufficient",
|
||||
// "An assistant message with 'tool_calls' must be followed by tool messages
|
||||
// responding to each 'tool_call_id'. (insufficient tool messages following
|
||||
// tool_calls message)" 落到额度类目就会把协议错误报成"渠道余额不足",
|
||||
// 掩盖真正的原因(历史里的工具结果不连续)。
|
||||
case strings.Contains(normalized, "must be followed by tool messages"),
|
||||
strings.Contains(normalized, "insufficient tool messages following"):
|
||||
return "会话里的工具调用与结果不匹配,本轮已停止;这不是额度或提示词问题,如反复出现请反馈", true
|
||||
case strings.Contains(normalized, "quota"), strings.Contains(normalized, "insufficient"), strings.Contains(normalized, "balance"), strings.Contains(normalized, "billing"):
|
||||
return "模型服务额度不足,请检查渠道余额或配额", true
|
||||
case strings.Contains(normalized, "model") && (strings.Contains(normalized, "not found") || strings.Contains(normalized, "permission") || strings.Contains(normalized, "access")):
|
||||
|
||||
Reference in new issue
Block a user