Skip to content

Config precedence ignored #28177

Closed as not planned
Closed as not planned

Description

@mewa

Description

According to the docs project-level opencode config should override global config, but that's not the case.

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

Plugins

No response

OpenCode version

1.15.4

Steps to reproduce

  1. Put the following config in ~/.opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "chrome-devtools": {
      "type": "local",
      "command": ["npx", "-y", "chrome-devtools-mcp@latest", "--isolated"]
    }
  },
  "tools": {
    "chrome-devtools_*": false
  }
}
  1. Put the following config in opencode.json in project's directory
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "chrome-devtools": {
      "enabled": true
    }
  },
  "tools": {
    "chrome-devtools_*": true
  }
}
  1. Run opencode debug config --pure | jq '.mcp,.tools' in project's directory

Actual output:

{
  "chrome-devtools": {
    "type": "local",
    "command": [
      "npx",
      "-y",
      "chrome-devtools-mcp@latest",
      "--isolated"
    ],
    "enabled": false
  }
}
{
  "chrome-devtools_*": false
}

Expected output:

{
  "chrome-devtools": {
    "type": "local",
    "command": [
      "npx",
      "-y",
      "chrome-devtools-mcp@latest",
      "--isolated"
    ],
    "enabled": true
  }
}
{
  "chrome-devtools_*": true
}

Screenshot and/or share link

No response

Operating System

macOS Sequoia

Terminal

Ghostty

Activity

  1. github-actions commented on May 18, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from those (e.g. specific to MCP enabled field merging), please clarify the difference.

  2. nielsgron commented on Jul 10, 2026

    @nielsgron

    I can confirm this bug. I have multiple projects and each needs to use a different model, but I can't get this to work because the global opencode.json takes precedence. ConfigPaths.directories returns dirs in an order that only makes sense for first-wins consumers, but its main consumers (commands/agents/plugins config merge) are later-wins — so ~/.opencode silently overrides project .opencode, contradicting the docs ("project configs can override global defaults") and OpenCode's own file precedence (ConfigPaths.files does .toReversed() so nearest wins). Skills and themes each do their own, mutually inconsistent, thing.

  3. github-actions commented on Sep 9, 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