Skip to content

Commit 2fd7e02

Browse files
authored
fix: Fix preview session race: stop cleanupSession from killing new preview session (#977)
1 parent 098cee9 commit 2fd7e02

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

apps/twig/src/main/services/agent/service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,6 @@ For git operations while detached:
10001000
}
10011001
this.cleanupMockNodeEnvironment(session.mockNodeDir);
10021002
this.sessions.delete(taskRunId);
1003-
this.processTracking.killByTaskId(session.taskId);
10041003
}
10051004
}
10061005

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)