Opencode fails to launch if it cant write to config #5157

Closed
opened 2026-02-16 17:49:25 -05:00 by yindo · 0 comments
Owner

Originally created by @ShoeBoom on GitHub (Jan 12, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

created a fix in #8125

when opencode launches it will try to add "$schema": "https://opencode.ai/config.json" if it is not already there

If opencode is unable to write to config it crashes with this error

ran into this since my config is syslinked from nix-store and you cant write to nix-store

❯ opencode
EACCES: permission denied, open '/Users/usr/.config/opencode/opencode.jsonc'
    path: "/Users/usr/.config/opencode/opencode.jsonc",
 syscall: "open",
   errno: -13,
    code: "EACCES"

      at write (unknown:1:1)
      at load (src/config/config.ts:1167:19)
      at load (src/config/config.ts:1097:23)
      at src/config/config.ts:1064:23
      at resolveNetworkOptions (src/cli/network.ts:35:31)
      at src/cli/cmd/tui/thread.ts:119:31
      at processTicksAndRejections (unknown:7:39)

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @ShoeBoom on GitHub (Jan 12, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description **created a fix in #8125** when opencode launches it will try to add `"$schema": "https://opencode.ai/config.json"` if it is not already there If opencode is unable to write to config it crashes with this error ran into this since my config is syslinked from nix-store and you cant write to nix-store ``` ❯ opencode EACCES: permission denied, open '/Users/usr/.config/opencode/opencode.jsonc' path: "/Users/usr/.config/opencode/opencode.jsonc", syscall: "open", errno: -13, code: "EACCES" at write (unknown:1:1) at load (src/config/config.ts:1167:19) at load (src/config/config.ts:1097:23) at src/config/config.ts:1064:23 at resolveNetworkOptions (src/cli/network.ts:35:31) at src/cli/cmd/tui/thread.ts:119:31 at processTicksAndRejections (unknown:7:39) ``` ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bugnix labels 2026-02-16 17:49:25 -05:00
yindo closed this issue 2026-02-16 17:49:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5157