Repository navigation
adopt: write opencode's own global file; check managed-settings.d - #175
Merged
Merged
Conversation
- opencode reads config.json, opencode.json and opencode.jsonc in that order and deep-merges them, later wins; when it writes its global config itself it picks the first existing of jsonc, json, config.json and creates opencode.jsonc when none exists. Adoption now picks the same file, so a fresh install's opencode.jsonc is where the endpoint goes and nothing in the directory overrides it. A file we already adopted keeps being used (its sidecar and originals live next to it); a higher-precedence file created later is reported as taking precedence, Blocking only when it sets provider.thinkwatch. The scan reads all three files for MCP servers. - Claude Code merges managed-settings.d/*.json (alphabetical, hidden and non-.json skipped) after managed-settings.json, later wins. The diagnosis now reports each drop-in (new codes adopt.diag.managed_dropin and adopt.diag.managed_dropin.detail). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
linux/adopt-shadows
branch
from
September 24, 2026 10:04
1824cd5 to
f929219
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #172: two files that take precedence over what adoption writes.
opencode:
opencode.jsoncvsopencode.jsonopencode's global config is three files that it deep-merges in order, later wins:
config.json,opencode.json,opencode.jsonc(anomalyco/opencode@0f54984packages/opencode/src/config/config.ts:272-274,mergeConfig= remedamergeDeepat:42-44). When opencode writes its global config itself, it picks the first existing file ofopencode.jsonc,opencode.json,config.json(globalConfigFile,:140-148, used byupdateGlobalat:656-657). If none exists, it createsopencode.jsoncwith just$schemaon first run (:263-270).Chosen behaviour: write where opencode itself writes, i.e. the highest-precedence existing file, or a new
opencode.jsonc. Why this is the least surprising option:opencode.jsonc. Keepingopencode.jsonand listing.jsoncas a file that takes precedence would flag every user over a file that holds only$schema, and our endpoint would sit in a file opencode itself never edits.A file we already adopted stays the target, because its sidecar record and originals sit next to it and restore needs them. If the user later creates a higher-precedence file, the diagnosis and the adoption plan report it with the existing "takes precedence" sentences. That finding is Blocking only when the newer file sets
provider.thinkwatch; otherwise opencode's deep merge keeps our fields and it is Suspect. The MCP scan now reads all three files.Claude Code:
managed-settings.d/Per https://code.claude.com/docs/en/managed-settings ("Split a file-based policy across teams"), Claude Code merges
managed-settings.jsonfirst, then every*.jsoninmanaged-settings.d/in alphabetical order. It skips hidden files and files not ending in.json, and on the same key the later file wins (envmerges key by key). Together they form one managed source that takes precedence over the user's settings. The diagnosis now reports each drop-in on all three platforms, since the directory sits next tomanaged-settings.jsonin each platform's system directory. A drop-in is Blocking when it carries one of the environment variables we write.New msg codes:
adopt.diag.managed_dropin,adopt.diag.managed_dropin.detail.🤖 Generated with Claude Code