mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-15 18:30:39 +09:00
Polish issue chat chain-of-thought rendering
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
2a372fbe8a
commit
627fbc80ac
7 changed files with 404 additions and 37 deletions
38
ui/src/lib/transcriptPresentation.test.ts
Normal file
38
ui/src/lib/transcriptPresentation.test.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { describeToolInput, summarizeToolInput } from "./transcriptPresentation";
|
||||
|
||||
describe("summarizeToolInput", () => {
|
||||
it("prefers human descriptions over raw commands when both exist", () => {
|
||||
expect(
|
||||
summarizeToolInput("command_execution", {
|
||||
description: "Inspect the issue chat thread layout classes",
|
||||
command: "zsh -lc 'sed -n \"1,220p\" ui/src/components/IssueChatThread.tsx'",
|
||||
}),
|
||||
).toBe("Inspect the issue chat thread layout classes");
|
||||
});
|
||||
});
|
||||
|
||||
describe("describeToolInput", () => {
|
||||
it("keeps command tools description-first in the detail view", () => {
|
||||
expect(
|
||||
describeToolInput("command_execution", {
|
||||
description: "Inspect the issue chat thread layout classes",
|
||||
command: "zsh -lc 'sed -n \"1,220p\" ui/src/components/IssueChatThread.tsx'",
|
||||
cwd: "/workspace/paperclip",
|
||||
}),
|
||||
).toEqual([
|
||||
{ label: "Intent", value: "Inspect the issue chat thread layout classes", tone: "default" },
|
||||
{ label: "Directory", value: "/workspace/paperclip", tone: "default" },
|
||||
]);
|
||||
});
|
||||
|
||||
it("surfaces concise structured details for file tools", () => {
|
||||
expect(
|
||||
describeToolInput("read_file", {
|
||||
path: "ui/src/lib/issue-chat-messages.ts",
|
||||
}),
|
||||
).toEqual([
|
||||
{ label: "Path", value: "ui/src/lib/issue-chat-messages.ts", tone: "default" },
|
||||
]);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue