Skip to content

Commit 903fa58

Browse files
committed
Throw clear error when codex-acp binary is missing instead of falling back to npx
1 parent 341e7e7 commit 903fa58

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

docs/TROUBLESHOOTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,25 @@ Native modules (like node-pty) need to be rebuilt for your Electron version:
5151
pnpm --filter twig exec electron-rebuild
5252
```
5353

54+
## Codex agent crashes with GPU process errors
55+
56+
If you see repeated errors like:
57+
58+
```
59+
[ERROR:gpu_process_host.cc(997)] GPU process exited unexpectedly: exit_code=5
60+
[FATAL:gpu_data_manager_impl_private.cc(448)] GPU process isn't usable. Goodbye.
61+
```
62+
63+
The codex-acp binary hasn't been downloaded. When it's missing, the app falls back to `npx` which spawns inside Electron's environment and triggers Chromium GPU process crashes.
64+
65+
### Fix
66+
67+
```bash
68+
node apps/twig/scripts/download-binaries.mjs
69+
```
70+
71+
Then restart the app. This downloads the codex-acp binary to `apps/twig/resources/codex-acp/`, which gets copied to `.vite/build/codex-acp/` during build.
72+
5473
## `pnpm i` shows "Packages: -198"
5574

5675
You might see something like this every time you run `pnpm install`:

packages/agent/src/adapters/codex/spawn.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ function findCodexBinary(options: CodexProcessOptions): {
5454
return { command: options.binaryPath, args: configArgs };
5555
}
5656

57+
if (options.binaryPath) {
58+
throw new Error(
59+
`codex-acp binary not found at ${options.binaryPath}. Run "node apps/twig/scripts/download-binaries.mjs" to download it.`,
60+
);
61+
}
62+
5763
return { command: "npx", args: ["@zed-industries/codex-acp", ...configArgs] };
5864
}
5965

0 commit comments

Comments
 (0)