fix(platform): 模型路由 - 合并PR并修复归档重试兼容

This commit is contained in:
ddCat
2026-08-20 13:24:09 +08:00
parent 51c79c5a65
commit a5bac9ec78
14 changed files with 365 additions and 70 deletions

View File

@@ -11,7 +11,7 @@ test("managed canvas agent task keeps tool definitions and tool results", () =>
[
{ role: "user", content: "读取画布" },
{ type: "function_call", call_id: "call-1", name: "canvas_get_state", arguments: "{}" },
{ role: "tool", tool_call_id: "call-1", content: "{\"nodes\":[]}" },
{ role: "tool", tool_call_id: "call-1", content: '{"nodes":[]}' },
],
[{ type: "function", function: { name: "canvas_get_state", parameters: { type: "object" } } }],
"required",
@@ -21,12 +21,12 @@ test("managed canvas agent task keeps tool definitions and tool results", () =>
assert.deepEqual(requests.responses.input, [
{ role: "user", content: "读取画布" },
{ type: "function_call", call_id: "call-1", name: "canvas_get_state", arguments: "{}" },
{ type: "function_call_output", call_id: "call-1", output: "{\"nodes\":[]}" },
{ type: "function_call_output", call_id: "call-1", output: '{"nodes":[]}' },
]);
assert.deepEqual(requests.chatCompletion.messages, [
{ role: "user", content: "读取画布" },
{ role: "assistant", content: null, tool_calls: [{ id: "call-1", type: "function", function: { name: "canvas_get_state", arguments: "{}" } }] },
{ role: "tool", tool_call_id: "call-1", content: "{\"nodes\":[]}" },
{ role: "tool", tool_call_id: "call-1", content: '{"nodes":[]}' },
]);
});