githubnext/chopinPublic

Let's compose rich plans together

Make a relative WORKING_DIR mean what it looked like it meant

`WORKING_DIR=../calmhn bun run dev` crashed with "Cannot call write after a
stream was destroyed", which is a sentence about neither working directories
nor paths.

Two faults behind it. The supervisor starts each child in its own package
directory, so a relative path was resolved against `apps/server` and pointed at
`chopin/apps/calmhn` — somewhere that does not exist. Relative paths are now
settled by the supervisor, where the current directory is still the one the
command was typed in.

And nothing checked. The path is handed to the agent's CLI as its own working
directory, so a bad one kills that process the instant it spawns and all the
SDK can report is a write to a stream that has already gone. A `stat` at
startup turns that into the path that is missing and which variable named it.

Verified by running the command that failed — it now starts against
GitHub/calmhn and the agent lists that project's files — and by pointing it
somewhere genuinely absent, which refuses with the path and takes Vite down
with it.
KCKrzysztof Cieslak authored
4ac8254Patch
Parentaffc368
5 files changed+179-13
StackedSplit
apps/server/src/config.test.ts+106 −0
apps/server/src/config.ts+26 −0
apps/server/src/main.ts+7 −1
readme.md+16 −10
scripts/dev.ts+24 −2