feat: add provider-native request switches (#5254)

This commit is contained in:
chengyongru
2026-08-05 18:26:39 +08:00
committed by GitHub
parent 5a1ab44baa
commit 67805f5db8
32 changed files with 1130 additions and 52 deletions
+15
View File
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import {
canonicalToolTrace,
mergeToolProgressTraceLines,
mergeUniqueToolTraceLines,
} from "@/lib/tool-traces";
@@ -26,4 +27,18 @@ describe("tool trace identity", () => {
added: true,
});
});
it("replaces an empty streaming placeholder when hosted search arguments arrive", () => {
expect(mergeToolProgressTraceLines(
["web_search()"],
[{ phase: "start", call_id: "ws-1", name: "web_search", arguments: {} }],
['web_search({"query":"nanobot news"})'],
[{
phase: "end",
call_id: "ws-1",
name: "web_search",
arguments: { query: "nanobot news" },
}],
)).toEqual(['web_search({"query":"nanobot news"})']);
});
});