Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/provider-pi/src/server/adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,7 @@ describe("PiAdapterV2", () => {
const cases = [
{
toolName: "read",
args: { path: "/workspace/screens/shot.png" },
args: { path: "@/workspace/screens/shot.png" },
result: { content, structuredContent: { ...image, note } },
expected: { content },
},
Expand Down
5 changes: 4 additions & 1 deletion packages/provider-pi/src/server/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1490,9 +1490,12 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
}
}
const output = piToolOutput(resultRecord, toolName);
// Pi strips @ only at the start of the raw argument, before preview trimming.
const readPath =
toolName === "read"
? (recordString(args, "path") ?? recordString(args, "file_path"))?.trim()
? (recordString(args, "path") ?? recordString(args, "file_path"))
?.replace(/^@/, "")
.trim()
: undefined;
const viewedImagePath =
readPath &&
Expand Down
Loading