Skip to content

fix: SDK 缓存复用与禁止多开 - #13

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/sdk-cache-single-instance-27c9
Oct 11, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/sdk-cache-single-instance-27c9

Conversation

@timeroute

@timeroute timeroute commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

问题

  1. 每次启动都会走 SDK 安装流程,并因 host 版本探测字符串不稳定(wslc version / wsl --version / unknown)导致 active.json 精确匹配失败,从而重复请求 NuGet、重复下载安装。
  2. 可同时打开多个进程,共享固定会话名 wslc-desktop,互相干扰。

改动

  • SDK 缓存:用 cache_compatible(缓存包 major ≥ host major)替代精确 host 字符串匹配;探测优先使用与启动门禁一致的 wsl --version;host 漂移时只刷新 stamp,不重新下载。仅在缓存过旧或用户点「重试」时再拉取。
  • 单实例:启动时用命名互斥量 Local\WSLcDesktop_SingleInstance;已有实例时弹窗提示并退出。
  • Release:CHANGELOG 并入 0.1.2;MSI workflow 允许同版本 tag 覆盖上传。

测试

  • cargo test --bin wslc-desktop sdk_version(含新增 cache_compatible 用例)通过。
  • PR 上 Windows MSI 构建已通过(bb3ec6d);changelog/workflow 小改后的 CI 跟进中。
Open in Web Open in Cursor 

Host probe strings drifted across launches, so exact stamp
matches failed and NuGet was hit again every start. Reuse any
major-compatible cached DLL; only re-download on Retry or when
the cache is too old. Named mutex stops a second process from
sharing the wslc-desktop session.

Co-authored-by: 绿岸公式 <chinesejar@gmail.com>
@timeroute
timeroute marked this pull request as ready for review October 11, 2026 10:08
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Co-authored-by: 绿岸公式 <chinesejar@gmail.com>
@cursor
cursor Bot merged commit 11e8e42 into main Oct 11, 2026
1 check passed
@timeroute
timeroute deleted the cursor/sdk-cache-single-instance-27c9 branch October 13, 2026 00:56
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.

2 participants