Open
Conversation
- search Scoop and Node.js global install paths when resolving Claude CLI on Windows - accept Windows cmd/bat wrappers during detection and route SDK launch through the real Claude Code cli.js entrypoint with node - classify launch failures more accurately and cover the regression with unit tests
claude-client:\n- normalize upstream Anthropic model ids back to Claude Code aliases before launch\n- add launch diagnostics for model, executable, env, stderr, and failure details\n- keep Windows wrapper resolution explicit so packaged builds launch the system Claude CLI predictably\n\nprovider-resolution:\n- inherit auth/base URL from ~/.claude/settings.json in env mode\n- stop relying only on process env or legacy DB settings for Claude-compatible providers\n\nroutes-and-bridge:\n- stop persisting SDK status model into chat sessions to avoid model pollution\n- preserve session model selection across bridge/chat runs\n\nroot-cause:\n- Windows env-mode sessions could store upstream model ids like claude-sonnet-4-20250514\n- Claude CLI launched with that invalid model against DashScope-compatible endpoints and exited with code 1
…ude-detection-launch
按功能分组:\n- src/lib/claude-client.ts 与 src/__tests__/unit/claude-client-launch.test.ts: 仅在同目录 npm cli.js 存在时才将 Windows .cmd/.bat 包装器改写为 node 启动,避免 Scoop shim 被解析到不存在路径\n- src/app/api/chat/route.ts 与 src/lib/bridge/conversation-engine.ts: 恢复 statusData.model 的 session 持久化,确保 env/provider 默认模型会写回会话\n- src/__tests__/unit/chat-route-model-persistence.test.ts: 新增回归测试覆盖模型持久化契约\n- src/__tests__/unit/claude-session-parser.test.ts: 修复 Windows ESM file URL 与 HOME/USERPROFILE 测试环境,消除既有 cancelled 测试\n\n根因:\n- Windows 启动路径推导默认假设所有 cmd 包装器都来自 npm 全局安装\n- status 事件返回的真实模型未再写回 chat_sessions\n- claude-session-parser 单测在 Windows 下使用磁盘路径直接 import ESM 导致失败\n\n影响范围:\n- Windows Claude CLI 检测与启动\n- chat/bridge 流程中的会话模型展示与统计\n- Windows 下单元测试稳定性
|
@fightZy is attempting to deploy a commit to the op7418's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
关联 Issue
Closes #174
概要
claude.cmd/.bat包装器被错误改写为不存在cli.js路径的问题,兼容 Scoop shim 等安装方式statusData.model的会话持久化,确保 env 或 provider 默认模型会写回 sessionclaude-session-parser在 Windows 下的既有单测问题根因
chat_sessions.modelclaude-session-parser单测在 Windows 下直接用磁盘路径动态导入 ESM,导致测试被取消验证
npm run test