Skip to content

Conversation

@ShoeBoom
Copy link
Contributor

@ShoeBoom ShoeBoom commented Jan 13, 2026

What does this PR do?

fixes #8126

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)

Could add logging to this, but since i don't think its a big issue it's best to just ignore.

alternatively instead of the error above you could show a nicer warning saying failed to add "$schema": "https://opencode.ai/config.json" to prompt the user to update their config manually

How did you verify your code works?

I looked at it

... fine i'll test it... , ran bun dev; launches fine with misconfigured config

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@rekram1-node rekram1-node merged commit c0b2142 into anomalyco:dev Jan 13, 2026
8 checks passed
sauerdaniel pushed a commit to sauerdaniel/opencode that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opencode fails to launch if it cant write to config

2 participants