src/server/spawn.ts and src/server/spawn.test.ts
Obeya starts most of its processes (git, Codex, Gemini) on two background threads. On Windows, Codex and Gemini looked as if they were not installed: their environment could not be copied to a thread, and the failure came back to the caller as a plain error, which the caller read as "not there".
Handover fails → the process starts anyway. If a process can't be handed to a thread, it now starts once on the server's thread and returns its output. The thread is left clean: nothing is noted as waiting on it, and it no longer keeps the server running. Obeya logs the failure once.
The tests catch a regression on every system. The existing test now also passes an environment behind a Proxy. Like process.env on Windows, that environment can't be copied, but here this holds on every system. The test also checks that the process ran on a thread. A new test hands over a value no thread can take and checks the fallback.
| Code | Environment test | Handover test |
|---|---|---|
| Both fixes | passes | passes |
| Without copying the environment | fails | passes |
| Without the fallback on the server's thread | passes | fails |
Both fixes:
7 pass 0 fail
Without copying the environment. The process no longer reaches its thread and only runs through the fallback; the test counts that one start on the server's thread:
error: expect(received).toBe(expected) Expected: 0 Received: 1 (fail) a process on a thread of its own gets what the server gives it: directory, environment, input, a timeout 6 pass 1 fail
Without the fallback. The call fails with the copy error, as Codex detection did on Windows:
DataCloneError: The object can not be cloned. name: "DataCloneError", (fail) a process a thread cannot be given starts on the server’s thread, once, and leaves nothing waiting on the thread 6 pass 1 fail
Both copy failures come from Bun's structured clone, which behaves the same on macOS, Linux and Windows. So neither test depends on the system. Locally run on macOS only; Linux and Windows run in CI. Whole suite: 2641 passed, 0 failed; typecheck clean.