Skip to content

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

Merged
kieranklaassen merged 1 commit intoEveryInc:mainfrom
mvanhorn:osc/125-fix-install-config-overwrite
Mar 10, 2026
Merged

fix(install): merge config instead of overwriting on opencode target#239
kieranklaassen merged 1 commit intoEveryInc:mainfrom
mvanhorn:osc/125-fix-install-config-overwrite

Conversation

@mvanhorn
Copy link
Contributor

@mvanhorn mvanhorn commented Mar 9, 2026

Summary

Fixes #125

The sync path's mergeJsonConfigAtKey had incoming plugin entries overwriting existing user entries when names conflicted. This reversed the spread order so user config always wins on conflict, matching the install path's existing merge behavior. Also adds user-facing log feedback when config is merged and a test for the sync merge path.

Changes

  • Fix spread order in src/sync/json-config.ts so existing user entries take precedence over incoming plugin entries
  • Add "merged" log message in src/targets/opencode.ts so users see their config was preserved
  • Add test verifying sync-path merge preserves user MCP server entries on conflict

Testing

  • bun test tests/opencode-writer.test.ts - all 9 tests pass
  • New test mergeJsonConfigAtKey > preserves existing user entries on conflict verifies user config wins

This contribution was developed with AI assistance (Claude Code).

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 EveryInc#125

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installing to opencode overwrites opencode.json file

2 participants