From d79959c3557a06abdcdd381109c110faea427c6c Mon Sep 17 00:00:00 2001 From: Raphaelowo <147674577+Raphaelowo@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:52:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96Win=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 让Win跟Linux一样可以显示缩短路径 以前 C:\Users\test\project\src\index.ts 现在 …/project/src/index.ts --- adapters/common/format.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/common/format.ts b/adapters/common/format.ts index d011d67a..e3e1efd7 100644 --- a/adapters/common/format.ts +++ b/adapters/common/format.ts @@ -223,7 +223,7 @@ function formatToolSummary(tool: string, inp: Record): string | } function shortPath(fp: string): string { - const parts = fp.split('/') + const parts = fp.replaceAll('\\', '/').split('/') return parts.length > 3 ? '…/' + parts.slice(-3).join('/') : fp } From e5ba5d5a07edd4de6c76dbd1749c8e052ac75a32 Mon Sep 17 00:00:00 2001 From: Raphaelowo <147674577+Raphaelowo@users.noreply.github.com> Date: Tue, 14 Jul 2026 01:55:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=B5=8B=E8=AF=95Windows?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=83=BD=E6=AD=A3=E5=B8=B8=E7=BC=A9=E7=9F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 输入C:\Users\test\project\src\index.ts 输出🔧 Read …/project/src/index.ts --- adapters/common/__tests__/format.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adapters/common/__tests__/format.test.ts b/adapters/common/__tests__/format.test.ts index 9ba63416..7815f704 100644 --- a/adapters/common/__tests__/format.test.ts +++ b/adapters/common/__tests__/format.test.ts @@ -118,8 +118,15 @@ describe('formatToolUse', () => { expect(result).toBe('🔧 Read …/project/src/index.ts') }) + + it('shortens Windows paths in file tool summaries', () => { + const result = formatToolUse('Read', {file_path: 'C:\\Users\\test\\project\\src\\index.ts'}) + + expect(result).toBe('🔧 Read …/project/src/index.ts') + }) }) + describe('formatPermissionRequest', () => { it('includes tool name, input preview, and request ID', () => { const result = formatPermissionRequest('Bash', { command: 'rm -rf /' }, 'abcde') From 3ab3eca21883555c3cf1cea8347ddefaf70097c5 Mon Sep 17 00:00:00 2001 From: Raphaelowo <147674577+Raphaelowo@users.noreply.github.com> Date: Tue, 14 Jul 2026 02:00:05 +0800 Subject: [PATCH 3/3] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- adapters/common/__tests__/format.test.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adapters/common/__tests__/format.test.ts b/adapters/common/__tests__/format.test.ts index 7815f704..128f7e4e 100644 --- a/adapters/common/__tests__/format.test.ts +++ b/adapters/common/__tests__/format.test.ts @@ -120,8 +120,7 @@ describe('formatToolUse', () => { }) it('shortens Windows paths in file tool summaries', () => { - const result = formatToolUse('Read', {file_path: 'C:\\Users\\test\\project\\src\\index.ts'}) - + const result = formatToolUse('Read', { file_path: 'C:\\Users\\test\\project\\src\\index.ts' }) expect(result).toBe('🔧 Read …/project/src/index.ts') }) })