Skip to content

fix windows chatwise connect#405

Merged
jackwener merged 3 commits intojackwener:mainfrom
aresbit:main
Mar 25, 2026
Merged

fix windows chatwise connect#405
jackwener merged 3 commits intojackwener:mainfrom
aresbit:main

Conversation

@aresbit
Copy link
Copy Markdown
Contributor

@aresbit aresbit commented Mar 25, 2026

chatwise-opencli.ps1 会清掉本地代理、彻底重启 ChatWise、带 --remote-debugging-port=9228 启动、等待调试端口可用后再调用 opencli
src/execution.ts 对 chatwise 加了更明确的 CDP 配置检查,避免没配端口时误连到错误目标
src/browser/cdp.ts 改成直连本地 HTTP 拉 /json,不再被 http_proxy/https_proxy 干扰

Copy link
Copy Markdown
Owner

@jackwener jackwener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

结论:方向对,而且我已经在当前分支补了一条关键 regression test;现在这版可以合。

深度 review 结论:

  • src/browser/cdp.ts 改成直连本地 HTTP 拉 /json,避免被 http_proxy/https_proxy 干扰,这个方向是对的
  • src/execution.tschatwise 缺失 OPENCLI_CDP_ENDPOINT 做 fail-fast,也比之前误连到错误 target 更可诊断
  • 🟡 这次新增了 Windows helper script chatwise-opencli.ps1,属于用户侧操作辅助,不是核心运行逻辑;本身没问题,但更应该被当成辅助入口,而不是唯一依赖路径
  • P1(已修):分支里对 chatwise fail-fast 的新行为没有 regression test,后面很容易被别的重构改掉

我直接推到分支上的 follow-up:

  • ce7ea31test(chatwise): cover missing cdp endpoint guard

具体改动:

  • src/engine.test.ts 里补了 chatwise 在缺少 OPENCLI_CDP_ENDPOINT 时会抛出清晰错误的测试
  • 同时在测试前统一 vi.unstubAllEnvs(),避免环境变量串扰

本地验证已过:

  • npx vitest run src/engine.test.ts src/browser/cdp.test.ts
  • npm run typecheck
  • npm test
  • npm run build

@jackwener jackwener merged commit 806b358 into jackwener:main Mar 25, 2026
23 checks passed
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