feat(core): recover truncated tool output via the Session scratchpad (#145)

Co-authored-by: Yaowei Zheng <hiyouga@buaa.edu.cn>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jingzhe Xu
2026-08-03 13:17:42 +08:00
committed by GitHub
parent 84949882ab
commit a798bca87f
30 changed files with 1393 additions and 47 deletions
@@ -0,0 +1,22 @@
import { describe, expect, it } from "vitest";
import { modelVisiblePath } from "../src/internal/model-visible-path.js";
describe("modelVisiblePath", () => {
it.skipIf(process.platform === "win32")(
"passes POSIX paths through, including backslash filename characters",
() => {
expect(modelVisiblePath("/tmp/a path/report.log")).toBe("/tmp/a path/report.log");
expect(modelVisiblePath("/tmp/we\\ird.log")).toBe("/tmp/we\\ird.log");
},
);
it.skipIf(process.platform !== "win32")(
"spells ordinary Windows and UNC paths with forward slashes",
() => {
expect(modelVisiblePath("C:\\Users\\x\\a path\\report.log")).toBe(
"C:/Users/x/a path/report.log",
);
expect(modelVisiblePath("\\\\server\\share\\report.log")).toBe("//server/share/report.log");
},
);
});