Skip to content

[codex] Fix WeChat automation on Windows - #2

Draft
ChutianWong wants to merge 3 commits into
lachlanchen:masterfrom
ChutianWong:windows-codex
Draft

[codex] Fix WeChat automation on Windows#2
ChutianWong wants to merge 3 commits into
lachlanchen:masterfrom
ChutianWong:windows-codex

Conversation

@ChutianWong

Copy link
Copy Markdown

Summary

  • Add Windows/WSL deployment support for the WeChat automation backend.
  • Fix Windows-side WeChat automation behavior and desktop launch log handling.
  • Publish the work from the new windows-codex branch instead of continuing the earlier Claude branch.

Validation

  • PYTHONPATH=src python -m unittest discover -s tests passed locally on Windows: 52 tests OK.

Notes

This PR is opened from ChutianWong:windows-codex into lachlanchen:master so the GitHub identity and PR branch stay on the Windows Codex path.

Haitao-Nie and others added 3 commits June 19, 2026 22:57
The WeChat chatops monitor and worker hard-coded the Codex CLI. Add a
pluggable backend so they can use Claude Code (claude -p) instead, selected
per-chat via the 'agent_backend' JSON key or via WECHAT_AGENT_BACKEND for the
worker pane. Codex remains the default, so existing setups are unaffected.

- New agent_backend.py: select_backend() + run_agent() dispatching to codex or
  claude. The read-only monitor path hard-blocks mutating/exec tools and never
  prompts, so it stays safe head-less; the worker path is writable.
- wechat_ops.py: doctor checks the selected backend CLI; init-config gains
  --agent-backend and writes a claude block.

Also make the virtual desktop usable from a Windows/WSL2 checkout:
- .gitattributes forces *.sh to LF (a Windows checkout otherwise yields CRLF
  that breaks bash with 'set: pipefail: invalid option name').
- launch_virtual_desktop.sh / wechat_virtual_desktop.sh run x11vnc and WeChat
  with WAYLAND_DISPLAY unset (+ QT_QPA_PLATFORM=xcb) so they attach to the Xvfb
  display instead of escaping to the host WSLg Wayland session.
- docs/WSL_WINDOWS_DEPLOY.md: end-to-end runbook (no secrets).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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