fix(opencode): normalize tool paths across platforms (#2459)

Normalize backslash paths for OpenCode formatting and add branch coverage for GitHub coordination behavior.
This commit is contained in:
Alexis D. 2026-07-26 12:13:49 +02:00 committed by GitHub
parent 5a4777777d
commit 71438391e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 805 additions and 1 deletions

View file

@ -108,6 +108,24 @@ async function main() {
),
])
tests.push([
"format-code: normalizes Windows backslash paths to forward slashes",
async () => withTempProject(
["tsconfig.json", "src/index.ts"],
async (projectDir) => {
const context = createMockContext(projectDir)
const result = await tools.formatcode.execute(
{ filePath: "src\\index.ts" },
context
)
const parsed = JSON.parse(result)
assert.strictEqual(parsed.success, true)
assert.ok(parsed.command.includes("src/index.ts"), `expected forward slashes in command: ${parsed.command}`)
assert.ok(!parsed.command.includes("src\\index.ts"), `unexpected backslashes in command: ${parsed.command}`)
}
),
])
tests.push([
"format-code: detects Python formatter",
async () => withTempProject(