Files
clash-verge-rev/Changelog.md
T
wonfen 22947632c0 refactor: Rewrite and improve sysproxy logic (#7744)
* fix(cmd): preserve anyhow context in coded errors

Use alternate error formatting so coded failures retain the full anyhow context chain without changing their wire format.

* fix(macos): skip redundant proxy disable writes

When both proxy modes are off, read macOS state first and skip networksetup if the OS is already clean. Update the guard target only after a successful write.

* feat(proxy): classify system proxy failures

Attach stable, actionable proxy failure codes to anyhow chains while preserving the original diagnostic causes.

* feat(cmd): return structured command failures

Replace encoded error strings with serializable code and detail fields, and update frontend notice consumers to handle the structured shape.

* fix(scripts): use the js-yaml namespace import

Import js-yaml through its ESM namespace so the i18n cleanup script can access load and dump.

* feat(proxy): localize classified proxy failures

Map privilege and direct-fallback codes to localized explanations, and let mapped causes outrank generic operation keys in notices.

* fix(ui): bound notice text and render failure details

Limit resolved notice text without truncating clipboard content, and normalize structured failures embedded in translation parameters.

* feat(proxy): persist unseen proxy failures

Store unresolved classified failures by code, notify the frontend when the table changes, and show each failure sequence once when a visible window can receive it.

* feat(proxy): report tray and hotkey toggle failures

Record classified failures from tray and hotkey proxy toggles so they appear when a visible window is available.

* fix(ui): restore the proxy switch after failed toggles

Refresh frontend proxy state after a failed toggle so the switch reflects the rolled-back configuration.

* feat(proxy): stop the guard after repeated failures

Report guard outcomes, stop after the failure threshold, and persist the classified failure for the frontend.

* fix(macos): preserve proxy during service handoff

Stop a sidecar being handed to the service without clearing proxy state that the new owner must inherit.

* feat(macos): classify misplaced sidecar state

Distinguish a refused sidecar proxy write from a machine that still needs the privileged service installed.

* feat(ui): recover misplaced sidecar notices

Offer a restart action for macOS proxy failures caused by a ready service while the core still runs as a sidecar.

* feat(ui): install the service from proxy notices

Let privilege notices install the macOS service, restart the core, and report the runtime mode that was actually reached.

* feat(cmd): attach requested proxy operations

Carry the requested proxy direction with structured command failures when the originating command knows it.

* feat(sysproxy): drain guards before OS access

Wait for the local proxy guard to stop before OS reads, service handoff, or final writes, and refuse transitions when it does not drain.

* feat(sysproxy): recover partial proxy writes

Use write progress to choose whether to restore the old guard or compensate with a disabled proxy state, while preserving actionable errors.

* feat(sysproxy): skip already-applied proxy writes

Compare macOS proxy snapshots with global, PAC, and disabled targets so matching state avoids redundant privileged writes.

* feat(proxy): report background proxy failures

Persist and surface classified proxy failures from lifecycle paths that have no direct caller awaiting the result.

* feat(ui): move proxy recovery into a dialog

Guide users through installing or switching to the service after a refused proxy write, and suppress duplicate toast reports.

* fix(ui): close proxy dialog after service recovery

Dismiss the recovery dialog once the core reaches service mode, even when the original proxy request remains pending.

* feat(ui): retry proxy request after service recovery

Replay the requested proxy direction after the core reaches service mode, while leaving incidental restores unchanged.

* fix(proxy): refresh state after successful apply

Publish the proxy refresh from the shared apply path after releasing the lifecycle lock, and remove the tray-specific duplicate.

* feat(ui): show proxy recovery progress

Display installation, restart, and proxy-apply stages while keeping the primary action spinner visible during recovery.

* feat(ui): route unavailable TUN through service recovery

Let the TUN switch request service recovery and restore its requested state after the core restarts in service mode.

* fix(ui): avoid duplicate TUN recovery errors

Roll back deferred TUN toggles without reporting an error, and publish configuration refreshes from the transaction commit path.

* chore: update changelog & pinlock

* fix(core): resolve platform-specific clippy warnings

* fix(core): detect Windows wildcard TCP conflicts

Windows permits a specific exclusive bind beside an existing non-exclusive wildcard listener. Consult the system TCP listener table so the probe reports that overlap as a conflict.
2026-08-14 23:52:37 +08:00

3.4 KiB

v2.5.3

🐞 修复问题

修复 macOS 多显示器切换时托盘速率样式不同步 修复 WebSocket 在 onConnected 初始化完成前被保存的问题,避免初始化失败后留下无监听且无法重试的无效连接。 修复 Mihomo API 变更后 inline proxy-provider 被错误过滤的问题,解决节点显示 Unknown 及延迟测试失败的问题 修复 macOS 开启「访问系统范围设置需要管理员密码」时无法设置系统代理的问题 修复从未开启过系统代理的用户,每次内核启动都收到报错的问题 修复受限机器上「安装服务 → 自动切换到服务模式」整条流程无法走通的问题 修复系统代理开关切换失败后,界面停留在错误状态的问题 修复托盘与热键切换系统代理失败时没有任何提示的问题 修复代理守卫反复失败后无限重试且不告知用户的问题 修复错误提示只显示最外层信息、丢失具体原因的问题 修复过长的错误提示撑满界面的问题(右键复制仍为完整内容) 修复部分错误提示显示为 [object Object] 的问题 修复 i18n 清理脚本因导入方式错误而无法运行的问题

✨ 新增功能
  • 新增混合代理端口冲突自动回退:启动时检测端口占用并持久化可用端口,同时统一首页、设置与系统代理中的生效端口显示
  • 系统代理或 TUN 因权限被拒时弹出引导窗口,一步安装系统服务并自动恢复原本的设置
  • 引导窗口显示当前阶段:安装服务 / 重启内核 / 应用代理
  • 系统代理失败会保留到窗口可见时再呈现,不会因窗口隐藏或最小化而丢失
  • 区分「需要安装服务」与「服务已就绪但内核仍以 Sidecar 运行」,分别给出对应操作
🚀 优化改进
  • TUN 模式设置也遵循 原始配置 < Merge 覆写 < Script 脚本 < GUI
  • 优化监听端口冲突检测:代理端口按最终 Runtime 监听范围校验并协调三层持久化,隧道按实际地址与 TCP/UDP 协议检测且保留热重载
  • 优化代理数据处理:统一通过单一 IPC 获取有序代理视图,并增强刷新、链路选择、重复判断及异常状态下的稳定性
  • 新增 macOS 启动门禁,避免多用户环境下的实例冲突
  • 加强 Service 多用户隔离与身份认证,支持安全的 Owner 接管
  • 统一系统代理所有权,实现原子化代理切换
  • 新增旧版 Service 迁移引导与 Sidecar 安全回退
  • 优化核心启动、停止及更新流程,减少竞态与残留进程
  • 优化首页当前节点的交互
  • Linux 代理设置缺失必要命令时,给出明确命令缺失信息,避免模糊报错
  • 支持在前置规则与后置规则之间直接切换规则位置
  • 系统代理已经是目标状态时不再执行多余的系统写入
  • 系统代理写入半途失败后,系统状态、代理守卫与配置三者保持一致
  • 代理守卫连续失败后停止并告知,不再静默重试
  • TUN 模式开关不再需要单独的安装服务按钮,与系统代理走同一条恢复流程
  • 系统代理失败给出可操作的具体原因,而非操作系统的英文原文
  • 配置变更后统一广播刷新,界面开关与托盘状态保持同步
  • 重构命令层错误返回为结构化格式,保留完整诊断链