Skip to content

start.bat: face and hands never start when launched from inside an agent session #8

Description

@raydowns

What I saw

start.bat reports face: starting, but no face ever appears and nothing binds port 8790. The window it spawns opens and closes too fast to read. The voice line comes up normally, so the stack looks half alive with no explanation.

Caught in full, the spawned window says:

'run.bat' is not recognized as an internal or external command,
operable program or batch file.

What I expected

The face server starts and binds 8790, the same as it does when ai-visualizer\run.bat is double-clicked directly.

How to reproduce

Run start.bat from any process where the environment variable
NoDefaultCurrentDirectoryInExePath is set to 1:

set NoDefaultCurrentDirectoryInExePath=1
start.bat

The face never starts. Unset the variable and the same command works.

This is not an exotic setting. Claude Code sets it in its own tool environment. Confirmed on this machine:

  • inside Claude Code's shell: NoDefaultCurrentDirectoryInExePath = 1
  • in HKCU\Environment and HKLM\...\Session Manager\Environment: unset

So a Desktop double-click works fine, and the agent starting or testing its own stack fails. That is an awkward gap for this project specifically, since the agent is told it owns fixing and running these tools.

Cause

Both server launches name their script by bare filename:

start "agent face"  cmd /c "cd ai-visualizer && run.bat"
start "agent hands" cmd /c "cd barehands && run.bat"

Resolving a bare run.bat requires cmd to search the current directory, and that search is exactly what NoDefaultCurrentDirectoryInExePath disables. The cd succeeds, the lookup then fails, and because the failure happens inside a detached start window, it closes instantly and the parent reports nothing. run.bat's own pause-on-error never helps, because run.bat is never reached.

Suggested fix

Name each script by full path, and set the new window's working directory with start's /d instead of a cd inside the command:

start "agent face"  /d "%~dp0..\ai-visualizer" cmd /c ""%~dp0..\ai-visualizer\run.bat""
start "agent hands" /d "%~dp0..\barehands"     cmd /c ""%~dp0..\barehands\run.bat""

The doubled quotes are required: cmd /c strips one pair, so a path containing a space needs the inner pair to survive.

cmd /c is kept deliberately rather than letting start launch the .bat directly, so the launch never depends on the machine's .bat file association.

Evidence

Tested with the variable set to 1 (the failing condition), from a path containing a space:

Form Result
cmd /c "cd ai-visualizer && run.bat" (current) 'run.bat' is not recognized, nothing binds
start /d "<full path>" cmd /c ""<full path>\run.bat"" face binds 8790 / hands binds 8794

Verified against the real barehands\run.bat: port 8794 bound by the server process with the variable still set to 1.

Setup

  • Windows 11 Pro, 10.0.26200
  • Claude Code 2.1.251
  • Full stack installed: backtalk, barehands, ai-visualizer, ai-memory-vault
  • Not audio or camera related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions