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 03:13:49 -07:00
committed by GitHub
parent 5a4777777d
commit 71438391e8
5 changed files with 805 additions and 1 deletions
+18
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(