eca icon indicating copy to clipboard operation
eca copied to clipboard

Custom tools hang on Windows — `p/shell "bash -c"` blocks indefinitely

Open snoopier opened this issue 7 months ago • 0 comments

Custom tools defined in config.json hang indefinitely on Windows (MSYS2/ucrt64). The tool invocation never returns, even for trivial commands like echo hello.

Root Cause

custom.clj hardcodes "bash -c" via p/shell:

;; src/eca/features/tools/custom.clj line 29
(p/shell {:dir work-dir
          :out :string
          :err :string
          :continue true} "bash -c" resolved-command)

This differs from shell.clj which:

  1. Respects the toolCall.shellCommand config (shell-path, shell-args)
  2. Uses platform detection (powershell.exe on Windows, bash on Unix)

The p/shell call with "bash -c" on Windows appears to block — the process is visible in Process Explorer but never completes, even for echo hello.

Expected Behavior

Custom tools should use the same shell execution logic as the native shell_command tool, i.e., either:

  1. Respect the toolCall.shellCommand.path and toolCall.shellCommand.args config
  2. Or use the platform-aware start-shell-process! function from shell.clj

snoopier avatar Apr 23 '26 09:04 snoopier