Fix write tool activity mapping
This commit is contained in:
@@ -245,6 +245,27 @@ describe("opencode tool-call mapper", () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("maps completed write calls with OpenCode success text into canonical detail", () => {
|
||||||
|
const item = expectMapped(
|
||||||
|
mapOpencodeToolCall({
|
||||||
|
toolName: "write",
|
||||||
|
callId: "opencode-write-success-text",
|
||||||
|
status: "completed",
|
||||||
|
input: {
|
||||||
|
filePath: "/Users/moboudra/.paseo/worktrees/1luy0po7/cold-ladybug/dummy.txt",
|
||||||
|
content: "hello world\n",
|
||||||
|
},
|
||||||
|
output: "Wrote file successfully.",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(item.detail).toEqual({
|
||||||
|
type: "write",
|
||||||
|
filePath: "/Users/moboudra/.paseo/worktrees/1luy0po7/cold-ladybug/dummy.txt",
|
||||||
|
content: "hello world\n",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("maps skill calls to plain text detail with the loaded skill name", () => {
|
it("maps skill calls to plain text detail with the loaded skill name", () => {
|
||||||
const item = expectMapped(
|
const item = expectMapped(
|
||||||
mapOpencodeToolCall({
|
mapOpencodeToolCall({
|
||||||
|
|||||||
@@ -387,6 +387,10 @@ export const ToolWriteInputSchema = z
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const ToolWriteOutputSchema = z.union([
|
export const ToolWriteOutputSchema = z.union([
|
||||||
|
z.string().transform(() => ({
|
||||||
|
filePath: undefined,
|
||||||
|
content: undefined,
|
||||||
|
})),
|
||||||
z.intersection(ToolPathInputSchema, ToolWriteContentSchema).transform((value) => ({
|
z.intersection(ToolPathInputSchema, ToolWriteContentSchema).transform((value) => ({
|
||||||
filePath: value.filePath,
|
filePath: value.filePath,
|
||||||
content:
|
content:
|
||||||
|
|||||||
Reference in New Issue
Block a user