Description
With OPENCODE_DISABLE_PROJECT_CONFIG=true, the v2 config service still discovers repository-controlled opencode.json / opencode.jsonc files and .opencode, .claude, and .agents directories.
The legacy config loader honors the flag for project OpenCode configuration, and v2 instruction discovery already honors it for project AGENTS.md. The v2 core config loader does not. In managed/headless deployments, this lets a repository change permissions, plugins, agents, MCP servers, or skill sources after project configuration was explicitly disabled.
Plugins
None
OpenCode version
v2 at 828a4b3f15a3d2b0bca26b0fc09067397f1c924d
Steps to reproduce
- Check out the
v2 branch and install dependencies.
- Run the existing test that verifies project configuration is loaded, with the disable flag set:
cd packages/core
OPENCODE_DISABLE_PROJECT_CONFIG=true bun test test/config/config.test.ts --test-name-pattern 'loads supported scalar and resource configuration'
- The test passes (
1 pass, 0 fail), even though its project-level configuration should be excluded while the flag is enabled.
Expected: project configuration and project ecosystem directories are excluded; global configuration remains available.
Actual: project configuration is discovered exactly as it is without the flag. Config.discover() only skips discovery when the working directory is the global config directory and never checks Flag.OPENCODE_DISABLE_PROJECT_CONFIG.
Screenshot and/or share link
Not applicable; this is a headless configuration-loader issue.
Operating System
Linux
Terminal
Headless / shell
Description
With
OPENCODE_DISABLE_PROJECT_CONFIG=true, the v2 config service still discovers repository-controlledopencode.json/opencode.jsoncfiles and.opencode,.claude, and.agentsdirectories.The legacy config loader honors the flag for project OpenCode configuration, and v2 instruction discovery already honors it for project
AGENTS.md. The v2 core config loader does not. In managed/headless deployments, this lets a repository change permissions, plugins, agents, MCP servers, or skill sources after project configuration was explicitly disabled.Plugins
None
OpenCode version
v2at828a4b3f15a3d2b0bca26b0fc09067397f1c924dSteps to reproduce
v2branch and install dependencies.1 pass, 0 fail), even though its project-level configuration should be excluded while the flag is enabled.Expected: project configuration and project ecosystem directories are excluded; global configuration remains available.
Actual: project configuration is discovered exactly as it is without the flag.
Config.discover()only skips discovery when the working directory is the global config directory and never checksFlag.OPENCODE_DISABLE_PROJECT_CONFIG.Screenshot and/or share link
Not applicable; this is a headless configuration-loader issue.
Operating System
Linux
Terminal
Headless / shell