A merged change to OpenCode V2 adds the platform system configuration directory (/Library/Application Support/opencode on macOS, /etc/opencode on Linux, %ProgramData%\opencode on Windows) as a resolved config source that is loaded at the lowest precedence by ConfigDiscovery.discover, Config.load, and ConfigWatch.plan. Machine-wide settings and directory-backed definitions become defaults that user-global and project configuration can override; policies remain authoritative because ManagedPolicy evaluates documents in reverse order so files from the system directory still gain the highest file-based policy weight. The change introduces ConfigDiscovery.Sources.system, ConfigDiscovery.systemDirectory(), and a system?: boolean | string option on Config.Options; global: false now also skips the system directory. Unit and live tests were added for platform path resolution, priority ordering, system isolation, and watcher planning, and the core config test suite and checks passed.
The change fixes older issues about V2 not loading managed config from system locations (referenced fixes include #51107 and #53074) and includes follow-on commits to load macOS MDM managed preferences and simplify resolution. It generated pushback from reviewers who flag it as a major security regression because prior behavior treated system config as highest priority and thereby prevented user/project overrides of admin-managed settings; the new lowest-precedence defaulting alters that security posture except where policy evaluation still enforces precedence. The branch was merged after checks passed and then deleted.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.