mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
fix(dsh-plugin-browserskill): keep the terminal result card for multi-block results
browser_screenshot on an image-capable route returns text + image blocks; the shared result presenter required exactly one text block and bailed to the generic card (tool name + raw args). Project the first text block instead so the terminal card shows in both modes.
This commit is contained in:
@@ -524,4 +524,17 @@ describe("presentation", () => {
|
||||
} as never) as { card: string; output: string; exitCode: number };
|
||||
expect(view).toMatchObject({ card: "terminal", output: "clicked", exitCode: 0 });
|
||||
});
|
||||
|
||||
it("projects the text block of multi-block results (screenshot text + image)", () => {
|
||||
const { tools } = setup({});
|
||||
const screenshot = tools.get("browser_screenshot");
|
||||
const view = screenshot?.presentResult?.({}, {
|
||||
content: [
|
||||
{ type: "text", text: "[session s1] screenshot of tab 7" },
|
||||
{ type: "image", attachment: { attachmentId: "a1" } },
|
||||
],
|
||||
isError: false,
|
||||
} as never) as { card: string; output: string };
|
||||
expect(view).toMatchObject({ card: "terminal", output: "[session s1] screenshot of tab 7" });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user