Skip to content

fix(omo): detect unified config on the WSL side when the OpenCode dir is in WSL - #7550

Merged
farion1231 merged 1 commit into
farion1231:mainfrom
fszcd:fix/omo-wsl-unified-config
Sep 21, 2026
Merged

farion1231 merged 1 commit into
farion1231:mainfrom
fszcd:fix/omo-wsl-unified-config

Conversation

@fszcd

@fszcd fszcd commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Reopened from #7367 after branch restoration. @farion1231 already reviewed and approved the original at 2840692.

Root cause: when the OpenCode config directory lives inside WSL, the unified-config detection path only checks Windows-side paths and misses the WSL location. This fix adds WSL-side detection to the read/write/delete candidate paths.

Original PR: #7367

@fszcd
fszcd requested a review from farion1231 as a code owner September 21, 2026 15:15
@github-actions github-actions Bot added the backend Backend (Rust/Tauri) label Sep 21, 2026
@fszcd

fszcd commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@farion1231 Branch restored and resubmitted as this PR. The original #7367 could not be reopened because the head branch had been force-pushed after deletion. Content is identical to the approved commit 2840692. Ready for your review/merge.

@farion1231
farion1231 merged commit 37d0476 into farion1231:main Sep 21, 2026
7 checks passed
@farion1231

Copy link
Copy Markdown
Owner

Merged as 37d0476 — thank you @fszcd, both for the fix and for restoring the branch and resubmitting so quickly.

Before merging I confirmed the patch is identical to what I reviewed on #7367 at 2840692 (same patch-id), and CI is green on all four backend jobs here as well. A few things I appreciated:

  • Deriving the WSL home from the leading path segments (home/<user> / root) instead of walking up from the OpenCode dir. It stays correct for non-standard layouts, and it can't mis-derive a "home" for a non-WSL custom directory.
  • Routing read, write and delete through the same candidate list, so the three paths can't drift apart again.
  • Keeping the OS home as a fallback, which means the symlink workaround described in [Bug] WSL 下 OMO 统一配置 (~/.omo/omo.jsonc) 无法被 CC Switch 识别/写入:统一配置探测使用 Windows home #7363 keeps working for anyone who already set it up.
  • The new tests really do execute on windows-latest — I checked the CI log rather than assuming, since most of them are cfg(windows).

One optional follow-up, only if you feel like it: derive_wsl_home_dir and derive_wsl_default_mcp_path now share about 25 lines of identical UNC-prefix parsing, which could move into a small shared helper. Not needed for this fix, and a separate small PR would be welcome.

#7363 was closed by this merge, and the fix will go out with the next release.

aliveranme added a commit to aliveranme/cc-switch that referenced this pull request Sep 21, 2026
上游新增(fdbe3a85..37d0476):
- 8272707 fix(skills): 支持 skillId 与目录名不一致的技能安装和更新(farion1231#6381)——新增
  find_remote_skill_for_install / choose_doc_path:已保存源路径优先,其次目录名,
  metadata name 仅作唯一兜底
- 2c735bd fix(ui): 不合格卡片不再展开陈旧缓存的用量档位(ProviderCard 抽出
  scriptUsageActive 谓词,查询与展开判定共用)
- 09498c3 fix(ui): 单色预设图标改取前景色(ProviderPresetSelector)
- 7f39d88 test(claude-desktop): Linux 路径测试改在 unix 主机上运行,provider 同步测试
  补 Linux 覆盖(含 XDG_CONFIG_HOME 隔离)
- 48e572c/e06ff90f/d8e98be2/0859fa6a/4d2c6f07 预设与定价刷新:CN Codex 预设按
  Responses API 审计更新、MiniMax CN 迁 api.minimax.cn、BaiLing 迁 api.ant-ling.com
  并把 Ling-2.5-1T 换成 Ling-2.6-1T、AICodeWith 端点改 /v1、新增 FluxA Token Plan 合作
  预设(claude / claude-desktop / codex 三处,含 fluxa 图标与本地横幅)、DeepSeek V4 Pro
  定价修回高峰档 1.32/3.96/0.044 并补 Qwen3.8 2.4T A95B、Qwen3.8 27B、Hunyuan Hy4 Preview
- f6c9982 fix(claude-desktop): DeepSeek 路由暴露 1M 上下文变体(brandedRoutes supports1m,
  haiku 档仍钉 200K)
- 37d0476 fix(omo): OpenCode 目录在 WSL 时按 WSL 侧 home 探测统一配置(farion1231#7550)——
  config.rs 新增 derive_wsl_home_dir,omo.rs 改探 home 候选列表(WSL 侧优先)
- 060099d/970a6e4f 用户手册与赞助商文案(FluxA 采购链接)

冲突:无。53 文件 +1729/-213 全部自动合并。逐条核对第 4 节分歧点:本次改动未触及
proxy 转换/分类器/atomic_write/wire_api 迁移/deeplink/session_usage/接管判定/
NativeResponses 模板/hermes 排除表/lucide 内联图标等分歧实现;第 3 节 fork 专属文件
未被触碰。codex_config.rs 的 web_search 拒绝名单与 services/provider、coding_plan 的
MiniMax host 判定均为上游新增条目,与 fork 现有逻辑不冲突。

验证:cargo test --lib 3030 passed / 0 failed(+14 用例;Windows 按 6.3 用隔离 HOME);
pnpm vitest run 141 文件 1164 用例全绿(+1 文件);cargo fmt --check、cargo clippy
--all-targets -D warnings、pnpm typecheck、pnpm format:check、pnpm build:renderer 全绿。
上游最新 tag 仍为 v3.20.3(无新版本),fork 版本号保持 v3.20.3 未 bump。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend (Rust/Tauri)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants