Skip to content

Global configuration supersedes local configuration #19296

Closed as not planned
Closed as not planned

Description

@G-Guillard

Description

The documentation states :

Precedence order

Config sources are loaded in this order (later sources override earlier ones):

  • Remote config (from .well-known/opencode) - organizational defaults
  • Global config (~/.config/opencode/opencode.json) - user preferences
  • Custom config (OPENCODE_CONFIG env var) - custom overrides
  • Project config (opencode.json in project) - project-specific settings
  • .opencode directories - agents, commands, plugins
  • Inline config (OPENCODE_CONFIG_CONTENT env var) - runtime overrides

This means project configs can override global defaults, and global configs can override remote organizational defaults.

However, currently global config supersedes project config. (I suspect this behaviour is the cause of several other permissions-related github issues.)

Plugins

No response

OpenCode version

1.3.2

Steps to reproduce

  1. Set ~/.opencode/opencode.json and (local) opencode.json to either of :
  • restricted configuration :
{
  "$schema": "https://opencode.ai/config.json",
  "permission": {"*": "ask"}
}
  • unrestricted configuration :
{
  "$schema": "https://opencode.ai/config.json",
  "permission": {"*": "allow"}
}
  1. Launch opencode and ask "List directory content".
  2. Results :
  • global restricted + local unrestricted = "Permission required -> Read ."
  • global unrestricted + local restricted = no permission required.
  • no global configuration + local restricted = "Permission required -> Read ."
  • no global configuration + local unrestricted = no permission required.
    The two last cases are expected and show that the local configuration works. The two first cases are the opposite of the documented behaviour, and show that the global configuration supersedes the local one.

Screenshot and/or share link

No response

Operating System

MX Linux 23.6 Libretto

Terminal

xfce4-terminal 1.1.3

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 26, 2026
  2. github-actions commented on Mar 26, 2026

    @github-actions
    Contributor

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

  3. G-Guillard commented on Mar 26, 2026

    @G-Guillard
    Author

    Not a duplicate of #16897 according to its reporter, however it looks like a regression from #4217.

  4. added a commit that references this issue on Mar 27, 2026
    82a7390
  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 5, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions