fix(install): merge config instead of overwriting on opencode target

The sync path's mergeJsonConfigAtKey had incoming entries overwriting
existing user entries on conflict. Reverse the spread order so user
config wins, matching the install path's existing behavior.

Also add merge feedback logging and a test for the sync merge path.

Fixes #125

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Van Horn
2026-03-08 21:43:39 -07:00
parent 69f2a96e66
commit 1db76800f9
3 changed files with 41 additions and 1 deletions

View File

@@ -18,8 +18,8 @@ export async function mergeJsonConfigAtKey(options: {
const merged = {
...existing,
[key]: {
...existingEntries,
...incoming,
...existingEntries, // existing user entries win on conflict
},
}