fix(code-tools): launch errors on Windows & Qwen Code auth issue#13400
fix(code-tools): launch errors on Windows & Qwen Code auth issue#13400GeorgeDong32 merged 8 commits intomainfrom
Conversation
On Windows, `cmd.exe` can misinterpret multiline output from global CLI tool installations (e.g., Bun), leading to command execution failures. This change redirects the standard output and error of CLI tool installation commands to a log file on Windows, preventing `cmd.exe` from misinterpreting the output. This ensures more reliable and stable installations of CLI tools. Log files are created in the application's user data directory.
Replace app.getPath('userData') with loggerService.getLogsDir() to ensure
CLI tool install logs are written to the same directory as other Cherry
Studio logs. Removes unused 'app' import from electron.
Fixes #12985
3bba0b9 to
6b5b104
Compare
6b5b104 to
4dcfa3e
Compare
|
Note This comment was translated by Claude. The last two issues are reproducible, and I have verified that they are resolved. However, I cannot reproduce #12985 on my side, so I tentatively believe it can be solved with output redirection. @DeJeune @beyondkmp feel free to try it when you have time. Original Content后两个issue可复现,我这边验证解决了。但是 #12985 我这边复现不出来,暂时判断是输出重定向可以解决的。 @DeJeune @beyondkmp 有空可以试试 |
…inal args - Fix installedVersion not fetched when autoUpdateToLatest is false Separates version fetching from auto-update logic to ensure qwen-code auth-type detection works regardless of auto-update setting - Remove unnecessary quotes from Windows Terminal profile name Fixes potential parsing issues with wt -p argument Addresses review feedback on PR #13400
Replace custom compareVersions method with semver library for more robust version comparison (handles v-prefix, prereleases, etc.). No new dependencies needed as semver is already in package.json. Addresses review feedback on PR #13400
Convert backslashes to forward slashes in log file path for better cmd.exe compatibility. Addresses code review feedback on PR #13400
There was a problem hiding this comment.
Re-reviewed the latest revision. The previous blocking issue in the qwen-code path is resolved: installedVersion is now fetched independently of the auto-update branch, so the --auth-type openai workaround applies to already-installed qwen-code users as intended. The follow-up semver change also makes the version gate more robust. I don't see a new blocking issue in the current revision. LGTM.
DeJeune
left a comment
There was a problem hiding this comment.
Overall the fix is well-structured. One null-safety issue found with semver.coerce() — see inline comment.
Refactor version comparison to explicitly check coerce result before passing to semver.gte(). This improves code clarity and follows review feedback from PR #13400. Before: semver.gte(semver.coerce(installedVersion) || '0.0.0', '0.12.3') After: const coerced = semver.coerce(installedVersion) const needsAuthType = installedVersion && coerced && semver.gte(coerced, '0.12.3')
What this PR does
Before this PR:
After this PR:
userData/logs/cli-tools-install.log(vialoggerService.getLogsDir())Fixes #12985 #13442 #13473
Why we need it and why it was done in this way
The following tradeoffs were made:
>> "logfile" 2>&1) instead of--silentflag to preserve debug information for troubleshootingThe following alternatives were considered:
bun install --silent: Rejected because it would lose all debug informationLinks to places where the discussion took place: #12985
Breaking changes
None
Special notes for your reviewer
loggerService.getLogsDir()to ensure logs are written to the same directory as other Cherry Studio logsChecklist
/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note