Open
Conversation
Contributor
Author
|
这是从更大的 Windows 兼容性修复中拆出来的一个小 PR,只保留了与“首次安装后 First-Sync 无法正确完成”直接相关的最小修改,便于单独 review 和合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
在 Windows 环境下按仓库当前安装流程执行
install.ps1时,首次安装后经常出现 First-Sync 未正确完成的问题,表现为:data/agent_config.json为空或未正确生成data/officials_stats.json未生成data/live_status.json内容不完整或为空另外,在当前安装流程里,
scripts/sync_agent_config.py和install.ps1对workspace-*/scripts存在重复处理,容易导致后续脚本同步逻辑与目录链接逻辑冲突。本 PR 修改
1.
install.ps1Windows 下优先使用
python,不再优先使用python3。原因:
在部分 Windows 环境中,
python3会解析到WindowsApps的启动别名,而不是实际可用的 Python 解释器,导致 First-Sync 阶段运行脚本异常或未正确执行。2.
scripts/sync_agent_config.py注释掉
sync_scripts_to_workspaces()调用。原因:
install.ps1已经在安装阶段将workspace-*/scripts连接到项目scripts目录,再执行逐文件 symlink 同步会形成重复处理。在 Windows 下这会带来明显冲突风险。3.
scripts/sync_officials_stats.py读取 JSON 文件时显式使用
encoding='utf-8'。原因:
否则在 Windows 环境中读取
openclaw.json时可能因编码问题失败,并静默回退到默认模型值,导致officials_stats.json中所有官员模型错误显示为anthropic/claude-sonnet-4-6。结果
在本地 Windows 环境重新验证后:
install.ps1可成功完成安装agent_config.json、officials_stats.json、live_status.json可正常生成officials_stats.json中模型信息可正确读取openclaw.json中的配置说明
这个 PR 只包含与“Windows 首次安装同步失败”直接相关的 3 个最小修改,不包含其他额外功能调整。