feat(create): 创作首页会话化 - 工作态指示器/计划路线分离/单会话承载分镜/通知中心与空态 hero/历史抽屉分组/行操作 hover 菜单与重命名/任务按钮规范

This commit is contained in:
maomaochong-ai committed 2026-09-06 20:29:38 +08:00
1 parent 4e774e56f1
commit e9ab9cce51
8 files changed
+542 -1003

No files matched your search

+8
View File
@@ -295,6 +295,14 @@ func providerPayloadErrorCategory(raw string) (string, bool) {
return "模型服务额度不足,请检查渠道余额或配额", true
case strings.Contains(normalized, "model") && (strings.Contains(normalized, "not found") || strings.Contains(normalized, "permission") || strings.Contains(normalized, "access")):
return "模型不存在或当前渠道未获得模型权限", true
// 推理/思考模式模型通常禁止强制指定工具调用:DeepSeek 思考模式返回
// "Thinking mode does not support this tool_choice",其他 OpenAI 兼容
// 供应商措辞类似。归为固定可行动原因,画布智能体据此把首步的
// tool_choice=required 降级为 auto 重试一次。排在通用参数类目之前,
// 避免这类稳定标识落回笼统的"请检查模型和参数"。
case (strings.Contains(normalized, "thinking") || strings.Contains(normalized, "reasoning")) && strings.Contains(normalized, "tool_choice"),
strings.Contains(normalized, "tool_choice") && (strings.Contains(normalized, "not support") || strings.Contains(normalized, "unsupported")):
return "当前模型为思考/推理模式,不支持强制工具调用(tool_choice=required),请改用自动工具选择或更换非思考模式模型", true
case strings.Contains(normalized, "invalid"), strings.Contains(normalized, "parameter"), strings.Contains(normalized, "argument"):
return "模型服务拒绝了请求,请检查模型和参数", true
}
@@ -608,6 +608,8 @@ func TestProviderPayloadErrorMessageUsesSafeActionableCategories(t *testing.T) {
{name: "moderation", raw: "request blocked by content policy: prompt=private", want: "安全审核"},
{name: "quota", raw: "insufficient quota for api-key=secret", want: "额度不足"},
{name: "model access", raw: "model not found for tenant secret-id", want: "模型不存在"},
{name: "thinking mode rejects forced tool choice", raw: `{"error":{"message":"Thinking mode does not support this tool_choice","request_id":"secret-trace"}}`, want: "不支持强制工具调用"},
{name: "reasoning mode rejects forced tool choice", raw: `{"error":{"message":"tool_choice=required is not supported in reasoning mode"}}`, want: "不支持强制工具调用"},
{name: "unknown", raw: "trace_id=private internal stack", want: "模型服务返回失败"},
}
for _, tt := range tests {
@@ -682,6 +684,12 @@ func TestProviderUserFacingErrorMessageClassifiesRejectedRequestBodies(t *testin
body: "",
want: "请检查模型和参数",
},
{
name: "thinking mode rejects forced tool choice",
statusCode: http.StatusBadRequest,
body: `{"error":{"message":"Thinking mode does not support this tool_choice","request_id":"secret"}}`,
want: "不支持强制工具调用",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {