From 58052984ff1fc5d307aec6f50a12481c26acfa10 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 7 Mar 2026 06:42:58 +0900 Subject: [PATCH] remove trash --- .issue-comment-2064.md | 61 ------------------------------------------ 1 file changed, 61 deletions(-) delete mode 100644 .issue-comment-2064.md diff --git a/.issue-comment-2064.md b/.issue-comment-2064.md deleted file mode 100644 index 39a6f4863..000000000 --- a/.issue-comment-2064.md +++ /dev/null @@ -1,61 +0,0 @@ -[sisyphus-bot] - -## Confirmed Bug - -We have identified the root cause of this issue. The bug is in the config writing logic during installation. - -### Root Cause - -**File:** `src/cli/config-manager/write-omo-config.ts` (line 46) - -```typescript -const merged = deepMergeRecord(existing, newConfig) -``` - -When a user runs `oh-my-opencode install` (even just to update settings), the installer: -1. Reads the existing config (with user's custom model settings) -2. Generates a **new** config based on detected provider availability -3. Calls `deepMergeRecord(existing, newConfig)` -4. 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). - -### Why This Happens - -Looking at `deepMergeRecord` (line 24-25): -```typescript -} 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). - -### Fix Approach - -The merge direction should be reversed to respect user overrides: -```typescript -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 - -### SEVERITY: HIGH - -- **Impact:** User configuration is overwritten without consent -- **Affected Files:** - - `src/cli/config-manager/write-omo-config.ts` - - `src/cli/config-manager/deep-merge-record.ts` -- **Trigger:** Running `oh-my-opencode install` (even for unrelated updates) - -### Workaround (Until Fix) - -Backup your config before running install: -```bash -cp ~/.config/opencode/oh-my-opencode.jsonc ~/.config/opencode/oh-my-opencode.jsonc.backup -``` - -We're working on a fix that will preserve your explicit model configurations.