Skip to content

Commit b5791e9

Browse files
author
Bertan Ari
committed
test(vscode-lm): wrap unknown-tool block so the offered-name guard decides the result
1 parent c72ce54 commit b5791e9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎src/api/providers/__tests__/vscode-lm.spec.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,15 @@ describe("VsCodeLmHandler", () => {
528528

529529
it("keeps an invoke block for an unknown tool as literal text", async () => {
530530
const block = '<invoke name="not_our_tool"><parameter name="a">1</parameter></invoke>'
531-
const chunks = await collect([block])
531+
const wrapped = `<function_calls>${block}</function_calls>`
532+
const chunks = await collect([wrapped])
532533

533-
expect(chunks.filter((chunk) => chunk.type === "text")).toEqual([{ type: "text", text: block }])
534+
expect(
535+
chunks
536+
.filter((chunk) => chunk.type === "text")
537+
.map((chunk) => chunk.text)
538+
.join(""),
539+
).toBe(wrapped)
534540
expect(chunks.some((chunk) => chunk.type === "tool_call")).toBe(false)
535541
})
536542

0 commit comments

Comments
 (0)