Fix categories not being deep merged in mergeConfigs #749
+120
−0
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.
Summary
categoriesnot being deep merged when combining user and project configsmergeConfigs()functionProblem
When merging user (
~/.config/opencode/oh-my-opencode.json) and project (.opencode/oh-my-opencode.json) configs,categorieswere simply spread instead of deep merged. This caused user-level category model settings to be completely overwritten by project-level configs, even when the project config only specified partial overrides liketemperature.Example of broken behavior:
Solution
Add
deepMergeforcategoriesfield inmergeConfigs(), consistent with howagentsandclaude_codeare already handled.After fix:
Testing
src/plugin-config.test.tswith BDD-style testsbun run typecheckpassesbun run buildsucceedsSummary by cubic
Fix category deep merge in mergeConfigs to preserve user settings. Prevent project overrides from wiping user-defined model fields.
Written for commit 6d4cebd. Summary will update on new commits.