fix(universal): 映射脚本上游模型名
ci / verify (pull_request) Successful in 9m51s

让 server-main 参数预处理兼容上下文使用平台绑定的真实模型名,避免把用户侧别名提交给上游。
This commit is contained in:
2026-07-22 03:56:00 +08:00
parent c72c43aaaa
commit 16149260c7
2 changed files with 8 additions and 4 deletions
+2 -2
View File
@@ -102,7 +102,7 @@ func TestUniversalClientSupportsServerMainScriptContextAndNestedResult(t *testin
"customGetParamsScript": map[string]any{
"image_generate": `async function getParams(params, context) {
const processed = await context.preProcessParams(params, context.type);
return { prompt: processed.prompt + "-" + context.processedParams.prompt };
return { prompt: processed.prompt + "-" + processed.model + "-" + context.processedParams.model };
}`,
},
"customSubmitScript": map[string]any{
@@ -128,7 +128,7 @@ func TestUniversalClientSupportsServerMainScriptContextAndNestedResult(t *testin
t.Fatalf("unexpected nested result: %#v", response.Result)
}
image, ok := data[0].(map[string]any)
if !ok || image["url"] != "https://cdn.example/hello-hello.png" {
if !ok || image["url"] != "https://cdn.example/hello-provider-model-provider-model.png" {
t.Fatalf("unexpected image result: %#v", response.Result)
}
}