mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-26 01:55:50 +00:00
fix(acp): use POSIX path semantics for ACP wire format paths
ToolCallLocation.path and Diff.path emitted over ACP must be absolute and POSIX-style per the v1 spec (tool-calls.mdx:304-306). The previous code used platform-specific `node:path` which on Windows prepends the drive letter (e.g. "D:\...") to POSIX-style inputs like "/Users/test/project" — silently corrupting paths emitted to ACP clients on Windows hosts. CI runs on Linux so the latent issue went undetected. Switch to `node:path/posix` so the path normalisation is host-OS independent. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
// Pure path-normalisation helper used by toolInfo / toolResults / forwarding.
|
||||
import { isAbsolute, resolve } from 'node:path'
|
||||
//
|
||||
// POSIX semantics are used so that emitted paths are platform-independent:
|
||||
// ACP v1 spec (tool-calls.mdx:304-306) requires ToolCallLocation.path /
|
||||
// Diff.path to be absolute, and the wire format is POSIX-style regardless of
|
||||
// the host OS. Using the platform-specific `node:path` here would prepend the
|
||||
// Windows drive letter (e.g. "D:\...") to POSIX-style inputs like
|
||||
// "/Users/test/project" — silently corrupting paths emitted to ACP clients.
|
||||
import { isAbsolute, resolve } from 'node:path/posix'
|
||||
|
||||
/**
|
||||
* Normalises an emitted file path against the session cwd so that
|
||||
|
||||
Reference in New Issue
Block a user