[sisyphus-bot]
We have identified the root cause of this issue. The bug is in the config writing logic during installation.
File: src/cli/config-manager/write-omo-config.ts (line 46)
const merged = deepMergeRecord(existing, newConfig)When a user runs oh-my-opencode install (even just to update settings), the installer:
- Reads the existing config (with user's custom model settings)
- Generates a new config based on detected provider availability
- Calls
deepMergeRecord(existing, newConfig) - Writes the result back
The problem: deepMergeRecord overwrites values in existing with values from newConfig. This means your custom "model": "openai/gpt-5.2-codex" gets overwritten by the generated default model (e.g., anthropic/claude-opus-4-6 if Claude is available).
Looking at deepMergeRecord (line 24-25):
} else if (sourceValue !== undefined) {
result[key] = sourceValue as TTarget[keyof TTarget]
}Any defined value in the source (generated config) overwrites the target (user's config).
The merge direction should be reversed to respect user overrides:
const merged = deepMergeRecord(newConfig, existing)This ensures:
- User's explicit settings take precedence
- Only new/undefined keys get populated from generated defaults
- Custom model choices are preserved
- Impact: User configuration is overwritten without consent
- Affected Files:
src/cli/config-manager/write-omo-config.tssrc/cli/config-manager/deep-merge-record.ts
- Trigger: Running
oh-my-opencode install(even for unrelated updates)
Backup your config before running install:
cp ~/.config/opencode/oh-my-opencode.jsonc ~/.config/opencode/oh-my-opencode.jsonc.backupWe're working on a fix that will preserve your explicit model configurations.