Skip to content

fix: 通过快捷方式打开mxu无法启动pretask进程#292

Merged
MistEO merged 1 commit into
MistEO:mainfrom
zmdyy0318:fix/2026071901
Jul 20, 2026
Merged

fix: 通过快捷方式打开mxu无法启动pretask进程#292
MistEO merged 1 commit into
MistEO:mainfrom
zmdyy0318:fix/2026071901

Conversation

@zmdyy0318

@zmdyy0318 zmdyy0318 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

opus4.8
image

Summary by Sourcery

通过将可执行文件路径解析方式与代理启动逻辑对齐,确保在通过快捷方式启动 MXU 时前置任务进程能够正确启动。

Bug Fixes:

  • 修复在 Windows 上由于相对可执行文件路径相对于父进程目录而非预期工作目录进行解析,从而导致前置任务启动失败的问题。

Enhancements:

  • 在代理启动和前置任务执行之间共享子进程可执行文件路径解析辅助函数,以在这两种流程中保持相对路径处理的一致性。
Original summary in English

Summary by Sourcery

Ensure pretask processes start correctly when MXU is launched via shortcuts by aligning executable path resolution with the agent startup logic.

Bug Fixes:

  • Fix pretask startup failures on Windows caused by relative executable paths being resolved against the parent process directory instead of the intended working directory.

Enhancements:

  • Share the child executable path resolution helper between agent startup and pretask execution to keep relative path handling consistent across both flows.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 我在这里提供了一些总体反馈:

  • 新的 resolved_program 逻辑是特定于 Windows 的,但却始终被应用;请考虑使用 cfg!(windows) 来保护该行为,或者在注释中澄清这种路径规范化是否也预期影响非 Windows 平台。
  • resolve_child_exec_path 现在返回一个 PathBuf,随后立刻通过 to_string_lossy 转换;如果 build_launch_command 能接受 OsStr/Path,建议避免有损转换,以便在文件系统条目不是 UTF-8 的情况下也能保留精确路径。
给 AI Agent 的提示
请解决本次代码评审中的各条评论:

## 总体评论
- 新的 `resolved_program` 逻辑是特定于 Windows 的,但却始终被应用;请考虑使用 `cfg!(windows)` 来保护该行为,或者在注释中澄清这种路径规范化是否也预期影响非 Windows 平台。
- `resolve_child_exec_path` 现在返回一个 `PathBuf`,随后立刻通过 `to_string_lossy` 转换;如果 `build_launch_command` 能接受 `OsStr`/`Path`,建议避免有损转换,以便在文件系统条目不是 UTF-8 的情况下也能保留精确路径。

Sourcery 对开源项目是免费的——如果你觉得我们的评审有帮助,请考虑分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've left some high level feedback:

  • The new resolved_program logic is Windows-specific but always applied; consider either guarding the behavior with cfg!(windows) or clarifying in comments whether the path normalization is intended to affect non-Windows platforms as well.
  • resolve_child_exec_path now returns a PathBuf that is immediately converted with to_string_lossy; if build_launch_command can accept OsStr/Path, consider avoiding lossy conversion to preserve exact paths, especially for non-UTF-8 filesystem entries.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `resolved_program` logic is Windows-specific but always applied; consider either guarding the behavior with `cfg!(windows)` or clarifying in comments whether the path normalization is intended to affect non-Windows platforms as well.
- `resolve_child_exec_path` now returns a `PathBuf` that is immediately converted with `to_string_lossy`; if `build_launch_command` can accept `OsStr`/`Path`, consider avoiding lossy conversion to preserve exact paths, especially for non-UTF-8 filesystem entries.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MistEO
MistEO merged commit d410fd3 into MistEO:main Jul 20, 2026
9 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