anomalyco / anomalyco/opencode

Global config silently ignored when ~/.config/opencode/opencode.json is a symlink (stow/dotfile managers broken since ~v1.18.x)

Open
#39,738 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 30, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When ~/.config/opencode/opencode.json is a symlink (e.g. managed via GNU Stow or similar dotfile managers), the config is silently ignored and opencode falls back to defaults. No error or warning is logged.

This worked correctly before the external_directory permission system was introduced (~v1.18.x). It appears the new permission system creates a chicken-and-egg problem: when loading the global config file, opencode resolves the symlink, detects the real path is outside ~/.config/opencode/, triggers external_directory authorization, but has no config loaded yet to evaluate the permission — so it silently discards the file.

Plugins

@mohak34/opencode-notifier@latest

OpenCode version

1.18.5

Steps to reproduce
  1. Place your opencode.json in a different directory, e.g. ~/dotfiles/opencode/.config/opencode/opencode.json
  2. Create a symlink: ln -sf ~/dotfiles/opencode/.config/opencode/opencode.json ~/.config/opencode/opencode.json
  3. Run: opencode debug config --print-logs
  4. Observe: logs show message=loading path=~/.config/opencode/opencode.json but the resolved config is empty (all defaults)
  5. Compare: OPENCODE_CONFIG=~/dotfiles/opencode/.config/opencode/opencode.json opencode debug config → config loads correctly
Screenshot and/or share link

No response

Operating System

macOS 26.6

Terminal

Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.