Repository navigation
Replies: 2 comments
|
The Especially for the Also, nice catch on the |
|
Both taken — and the Windows runner paid for itself on the first run. CI (
Numbers. Windows 11 (10.0.22631), Node 24.19.0: 131 failed / 1066 passed before, 1172 passed / 36 skipped / 0 failed after. The 36 skips are explicit in the specs ( The ubuntu job found one pre-existing flake while it was there: the Feishu consumer prints Branch and run: One thing I would rather say than imply: the POSIX-only specs skip themselves on my machine, so |
Uh oh!
There was an error while loading. Please reload this page.
在 Windows 11 上把
deepseek-ai/dsh-superagent-prototypev0.1.0(DSH 0.2.1-rc.5、Node 24、GitHub CLI 2.103.3)跑起来了。原型本身是一套很干净的设计,但代码里有四处 POSIX 假设,各自卡在不同阶段,全修完才走通「Issue → 评估 → 工单 → 自动开 PR」。记录在这里,给同样在 Windows 上试的人省点时间,也给作者留个档。六处不适配
src/deployment.tsstateDir$.stateDir expect string to match regexp /^\///开头,Windows 盘符路径必然不满足src/deployment.tsworkerProbespawn env ENOENTenv PATH=…,Windows 没有env这个程序src/app/sessions.tsorchestrator preset/orchestrator/api/*一律 404 且没有别的报错bash;Windows profile 里是pwsh,tools.restrict()拒绝未知名字,整个挂载被中断src/executor/dsh.tsprepareThe prepare command failed: spawn sh ENOENTsh -csrc/policy.tsexecutor.directoryInvalid settings: directory/开头」代替「是绝对路径」docs/006-deployment.md.cmd,prepare shell 也不可配第三条最阴:它不报错、不崩溃,只是编排那一块静默消失,表现是面板 404,很难从现象倒推回去。
改法
stateDir接受 POSIX / 盘符 / UNC 三种绝对路径。workerProbe在 POSIX 保留env PATH=…前缀;win32 直接传 argv —— 那个前缀本来是为了把 worker shim 排除出 PATH,而 Windows 上配置的是绝对路径,不需要它。bash/pwsh),跟 bundle 里已有的!!js process.platform === 'win32'写法一致。prepareShell(默认sh -c):POSIX 行为零变化,Windows 填cmd.exe /d /s /c或bash -lc。之所以不写死平台分支,是因为这样行为显式、可测,也不需要为「Windows 上用什么 shell」做猜测。executor.directory改用path.isAbsolute()。.cmd,所以 CLI 填gh.exe,把身份放进服务进程的GH_CONFIG_DIR)、prepareShell怎么填、两种 shell 的语法差异($VARvs%VAR%)。补丁:
Ersith/dsh-superagent-prototype分支windows-compat,commit6c53839,5 个文件+39/−8,pnpm build通过。比较链接:Ersith/dsh-superagent-prototype@main...windows-compat
验证
Windows 11 + DSH 0.2.1-rc.5 + GitHub CLI 2.103.3,端到端走了一遍:
eval.mode=auto→ 建工单;最后交付的 PR 是单行 diff(
README.md两行文件里的一行措辞)。测试说明(如实)
仓库的测试直接断言 POSIX 行为——spawn argv 以
env/sh开头、工具名bash。这些断言在 Windows 上本来就有 39 个失败;打了补丁后变 131 个,多出来的都是那些断言在新平台分支下看到的差异。我没有在 POSIX 主机上跑过全套,所以不能替你们保证 CI 绿。但代码上,POSIX 的每个判断都还是原来的值(同样的
env PATH=…前缀、同样的sh -cargv、同样的工具名、path.isAbsolute对 POSIX 路径的结果不变)。如果希望测试覆盖两个平台,我可以把 shell argv 和工具名抽成常量让 spec 读取,而不是硬编码。另外两处没动
scripts/dsh-superagent(Python +fcntl+ tmux)和src/app/migration.ts里对 tmux 的假设仍然是 POSIX 的。前者只是控制脚本,后者是迁移路径;这次改的是「产品本身能不能跑」,没碰它们。Windows 上我另外写了个start/stop/status的 PowerShell 启动器替代 tmux 那层。sessions.ts里 worker preset 已经在用平台判断,说明 Windows 不是明确不支持,只是没适配全 —— 所以这几处大概属于「补完」而不是「新增支持」。顺带一个非 Windows 的发现,可以单独开一条:线程 id 是
github:<编号>,不含仓库名(源码注释也写了 "of any repository")。在面板里更换 Source 的 repository 时,会跟旧仓同号 Issue 撞线程——我实测换仓后,新仓 #2 的标题被覆盖,但时间戳和裁决理由还是旧仓的,received也不增加。迁移路径可能需要处理这个。All reactions