Crash when running opencode from ~/.config/opencode directory #4536

Open
opened 2026-02-16 17:44:30 -05:00 by yindo · 2 comments
Owner

Originally created by @cineraria01 on GitHub (Jan 9, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Running opencode from the ~/.config/opencode directory causes an immediate crash with cleanNode abort error.

Steps to Reproduce

  1. Navigate to the opencode config directory:
    cd ~/.config/opencode
    
  2. Run opencode:
    opencode
    

Expected Behavior

OpenCode should start normally regardless of the current working directory.

Actual Behavior

OpenCode crashes immediately with the following stack trace:

abort@[native code]
@/$bunfs/root/src/index.js:214603:19
cleanNode@/$bunfs/root/src/index.js:210165:24
cleanNode@/$bunfs/root/src/index.js:210160:16
cleanNode@/$bunfs/root/src/index.js:210160:16
... (repeated cleanNode calls)
updateComputation@/$bunfs/root/src/index.js:209843:12
runTop@/$bunfs/root/src/index.js:209968:24
runUserEffects@/$bunfs/root/src/index.js:210099:11
runUpdates@/$bunfs/root/src/index.js:209989:20
completeUpdates@/$bunfs/root/src/index.js:210049:15
runUpdates@/$bunfs/root/src/index.js:209990:20
setStore@/$bunfs/root/src/index.js:213539:10
processTicksAndRejections@

Root Cause Analysis

The ~/.config/opencode directory contains package.json and node_modules (created automatically for plugin management). When opencode detects these files in the current working directory, it appears to treat the config directory as a project, causing a recursive conflict.

Workaround: Run opencode from any other directory (e.g., cd ~ && opencode).

Environment

  • OpenCode version: 1.1.8
  • OS: Linux 5.15.0-134-generic (Ubuntu)
  • Runtime: Bun

Additional Context

  • Running from home directory (~) works fine
  • Running from any other project directory works fine
  • Only crashes when CWD is ~/.config/opencode
Originally created by @cineraria01 on GitHub (Jan 9, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description Running `opencode` from the `~/.config/opencode` directory causes an immediate crash with `cleanNode` abort error. ## Steps to Reproduce 1. Navigate to the opencode config directory: ```bash cd ~/.config/opencode ``` 2. Run opencode: ```bash opencode ``` ## Expected Behavior OpenCode should start normally regardless of the current working directory. ## Actual Behavior OpenCode crashes immediately with the following stack trace: ``` abort@[native code] @/$bunfs/root/src/index.js:214603:19 cleanNode@/$bunfs/root/src/index.js:210165:24 cleanNode@/$bunfs/root/src/index.js:210160:16 cleanNode@/$bunfs/root/src/index.js:210160:16 ... (repeated cleanNode calls) updateComputation@/$bunfs/root/src/index.js:209843:12 runTop@/$bunfs/root/src/index.js:209968:24 runUserEffects@/$bunfs/root/src/index.js:210099:11 runUpdates@/$bunfs/root/src/index.js:209989:20 completeUpdates@/$bunfs/root/src/index.js:210049:15 runUpdates@/$bunfs/root/src/index.js:209990:20 setStore@/$bunfs/root/src/index.js:213539:10 processTicksAndRejections@ ``` ## Root Cause Analysis The `~/.config/opencode` directory contains `package.json` and `node_modules` (created automatically for plugin management). When opencode detects these files in the current working directory, it appears to treat the config directory as a project, causing a recursive conflict. **Workaround:** Run opencode from any other directory (e.g., `cd ~ && opencode`). ## Environment - **OpenCode version:** 1.1.8 - **OS:** Linux 5.15.0-134-generic (Ubuntu) - **Runtime:** Bun ## Additional Context - Running from home directory (`~`) works fine - Running from any other project directory works fine - Only crashes when CWD is `~/.config/opencode`
Author
Owner

@github-actions[bot] commented on GitHub (Jan 9, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6843: OpenCode crashes with Bun cleanNode abort when connecting to z.ai coding plan (similar cleanNode abort error)
  • #7173: Security Issue - Lifecycle Script Execution via .opencode/package.json (related to package.json in config directories and automatic bun install)
  • #3610: OPENCODE_CONFIG_DIR is broken since 0.15.30 when only world-readable (config directory handling and package.json conflicts)
  • #2794: 0.11.6 in conflict with config instructions (config directory validation issues)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 9, 2026): This issue might be a duplicate of existing issues. Please check: - #6843: OpenCode crashes with Bun cleanNode abort when connecting to z.ai coding plan (similar cleanNode abort error) - #7173: Security Issue - Lifecycle Script Execution via .opencode/package.json (related to package.json in config directories and automatic bun install) - #3610: OPENCODE_CONFIG_DIR is broken since 0.15.30 when only world-readable (config directory handling and package.json conflicts) - #2794: 0.11.6 in conflict with config instructions (config directory validation issues) Feel free to ignore if none of these address your specific case.
Author
Owner

@cravenceiling commented on GitHub (Jan 9, 2026):

Please run opencode --print-logs and opencode debug config.

@cravenceiling commented on GitHub (Jan 9, 2026): Please run `opencode --print-logs` and `opencode debug config`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4536