You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: OPENCODE_DISABLE_PROJECT_CONFIG is ignored in v2 #36837
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.
This issue might be related to existing issues. Please check:
OPENCODE_DISABLE_PROJECT_CONFIG silences config.instructions from OPENCODE_CONFIG #30233: A different bug with OPENCODE_DISABLE_PROJECT_CONFIG — when combined with OPENCODE_CONFIG, the flag causes config.instructions to silently resolve to nothing (instruction resolution stage ignores the explicitly provided config path). Different root cause and scope, but the same flag is involved.
It makes the v2 core loader skip repository-controlled opencode.json*, .opencode, .claude, and .agents discovery when the flag is enabled, while preserving global configuration. It also adds a regression test covering both sides of that boundary.
Validation:
packages/core config suite: 20 passed
packages/core typecheck passed
full pre-push monorepo typecheck: 32/32 packages passed
Happy to open a PR against v2 if this behavior matches the intended semantics.
changed the title [-]OPENCODE_DISABLE_PROJECT_CONFIG is ignored by the v2 core config loader[/-][+]core: OPENCODE_DISABLE_PROJECT_CONFIG is ignored in v2[/+]on Jul 14, 2026
Thanks for the report. We found this is part of a broader V1-to-V2 environment-variable compatibility gap, so we are consolidating the work in #36990. That umbrella issue includes OPENCODE_DISABLE_PROJECT_CONFIG and links back here. Closing this issue in favor of the larger tracker.
Activity
github-actions commentedon Jul 14, 2026
This issue might be related to existing issues. Please check:
OPENCODE_DISABLE_PROJECT_CONFIG— when combined withOPENCODE_CONFIG, the flag causesconfig.instructionsto silently resolve to nothing (instruction resolution stage ignores the explicitly provided config path). Different root cause and scope, but the same flag is involved.OPENCODE_CONFIG_DIR(treats it as a replacement for the global config directory rather than additive). A parallel v2 config loader discrepancy.These are distinct bugs, but if you're investigating the v2 config loader, the above may be worth coordinating on.
corrius commentedon Jul 14, 2026
I prepared a minimal fix on
corrius:fix/disable-project-config-v2(commit8078652).It makes the v2 core loader skip repository-controlled
opencode.json*,.opencode,.claude, and.agentsdiscovery when the flag is enabled, while preserving global configuration. It also adds a regression test covering both sides of that boundary.Validation:
packages/coreconfig suite: 20 passedpackages/coretypecheck passedHappy to open a PR against
v2if this behavior matches the intended semantics.[-]OPENCODE_DISABLE_PROJECT_CONFIG is ignored by the v2 core config loader[/-][+]core: OPENCODE_DISABLE_PROJECT_CONFIG is ignored in v2[/+]opencode-agent commentedon Jul 15, 2026
Thanks for the report. We found this is part of a broader V1-to-V2 environment-variable compatibility gap, so we are consolidating the work in #36990. That umbrella issue includes
OPENCODE_DISABLE_PROJECT_CONFIGand links back here. Closing this issue in favor of the larger tracker.opencode-agent commentedon Jul 15, 2026
Tracked in #36990.