Repository navigation
Commit 48f1d53
committed
fix: prevent libopentui.so extraction to /tmp on serve/headless mode
Three changes to fix issue anomalyco#20043 where opencode serve extracts libopentui.so (~4.2MB) to /tmp on every startup:
1. Made @opentui/keymap/extras import lazy (dynamic import) in tui.ts.
Native TUI library is now only loaded when TUI config is actually
initialized, not during static module evaluation. This prevents
extraction entirely in serve/headless mode.
2. Set BUN_TMPDIR=~/.cache/opencode/bun-runtime in the npm wrapper
script, redirecting native library extraction from /tmp to a stable
cache directory to avoid polluting shared temp space.
3. Added BUN_TMPDIR=/var/lib/opencode-bun-tmp in Dockerfile for
container deployments.1 parent 67ee715 commit 48f1d53
3 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
195 | 194 | | |
196 | 195 | | |
197 | 196 | | |
| 197 | + | |
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| |||
0 commit comments