Skip to content

Commit 38f9d52

Browse files
committed
Use path.posix.join for overflow path to preserve POSIX separators
Fixes Windows + SSH runtime compatibility. config.runtimeTempDir is always a POSIX path (e.g., /home/user/.cmux-tmp/token) even when cmux runs on Windows. Using path.join() would convert it to backslash form on Windows, breaking SSHRuntime.writeFile() which expects forward slashes. Solution: Always use path.posix.join() when constructing paths for runtime operations, regardless of host OS. Addresses Codex review comment PRRT_kwDOPxxmWM5fYEbF
1 parent bf46af4 commit 38f9d52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/services/tools/bash.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ export const createBashTool: ToolFactory = (config: ToolConfiguration) => {
422422
// Use 8 hex characters for short, memorable temp file IDs
423423
const fileId = Math.random().toString(16).substring(2, 10);
424424
// Write to runtime temp directory (managed by StreamManager)
425-
// This works for both LocalRuntime (local path) and SSHRuntime (remote path)
426-
const overflowPath = path.join(config.runtimeTempDir, `bash-${fileId}.txt`);
425+
// Use path.posix.join to preserve forward slashes for SSH runtime
426+
// (config.runtimeTempDir is always a POSIX path like /home/user/.cmux-tmp/token)
427+
const overflowPath = path.posix.join(config.runtimeTempDir, `bash-${fileId}.txt`);
427428
const fullOutput = lines.join("\n");
428429

429430
// Use runtime.writeFile() for SSH support

0 commit comments

Comments
 (0)