Skip to content

Fix miniprogram-automator startup on Ubuntu 25.04#172

Merged
msojocs merged 2 commits intomsojocs:masterfrom
TrueNine:codex/fix-miniprogram-automator-ubuntu-25-04
Apr 15, 2026
Merged

Fix miniprogram-automator startup on Ubuntu 25.04#172
msojocs merged 2 commits intomsojocs:masterfrom
TrueNine:codex/fix-miniprogram-automator-ubuntu-25-04

Conversation

@TrueNine
Copy link
Copy Markdown
Contributor

Summary

This PR fixes a Linux CLI startup regression that prevents miniprogram-automator from launching WeChat DevTools on Ubuntu 25.04.

Root cause

bin/wechat-devtools-cli exported APPDATA to the bundled nwjs directory instead of the user profile directory used by the normal desktop launcher, and it did not export USERPROFILE. On Ubuntu 25.04 this leaves CLI runtime state in the wrong location, so DevTools cannot bootstrap the expected profile, CLI handshake files, and service-port state reliably.

The CLI bootstrap path also needs to create the profile directory before writing .cli, .ide, and .ide-status, and the CLI HTTP server should only be considered ready after the process has actually bound the requested port. In addition, CLI-launched sessions need to force the service-port startup path instead of waiting for the regular UI timing used by interactive launches.

Changes

  • align the CLI launcher with the desktop launcher's XDG-based data directory handling
  • export USERPROFILE consistently for CLI-launched sessions
  • ensure the CLI bootstrap creates the profile directory before writing coordination files
  • make CLI service startup deterministic and only report readiness after listen() succeeds
  • keep the service port enabled for CLI-launched sessions so automation can connect reliably

Why this matters

miniprogram-automator relies on the CLI path to start DevTools and connect to the local service endpoint. Without these fixes, Ubuntu 25.04 can fail before the CLI handshake is established, so automation cannot bring the IDE up.

Main purpose

The main purpose of this change is to restore reliable Linux CLI startup on modern distributions by making CLI-launched DevTools use the same persistent runtime environment and service-port bootstrap flow as the normal desktop launcher.

Comment thread tools/patch-core.js Outdated
@msojocs msojocs force-pushed the codex/fix-miniprogram-automator-ubuntu-25-04 branch from d24371a to 1387e24 Compare April 15, 2026 13:39
@msojocs
Copy link
Copy Markdown
Owner

msojocs commented Apr 15, 2026

cli启动失败根因是这里之前写的参数不全
bac0cde

@msojocs msojocs merged commit bef11f3 into msojocs:master Apr 15, 2026
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