Skip to content

fix(weixin): make WeChat channel work in packaged macOS app#30

Merged
hetaoBackend merged 1 commit into
mainfrom
fix/weixin-packaged-macos-app
Jun 7, 2026
Merged

fix(weixin): make WeChat channel work in packaged macOS app#30
hetaoBackend merged 1 commit into
mainfrom
fix/weixin-packaged-macos-app

Conversation

@hetaoBackend

Copy link
Copy Markdown
Owner

Problem

The WeChat (Weixin) channel worked in dev but silently failed in the packaged macOS app — users saw a blank QR code with no error.

Two root causes:

  1. Minimal PATH — apps launched from Finder/Dock inherit a stripped PATH without Homebrew (/opt/homebrew/bin), so neither the Electron-spawned Python backend nor shutil.which("node") could find node.
  2. Bridge not bundled — the PyInstaller binary didn't ship channels/weixin_bridge, so even with node present there was no script to run.

Changes

  • channels/weixin_channel.py
    • Resolve node to a full path, falling back to /opt/homebrew/bin, /usr/local/bin, /usr/bin when not on PATH.
    • Load the bridge from sys._MEIPASS when frozen (PyInstaller) instead of beside the source module.
    • Surface missing-node (FileNotFoundError) and bridge start failures as an error login status (last_error) instead of failing silently.
  • Makefile + taskboard.spec — bundle channels/weixin_bridge into the binary via --add-data.
  • taskboard-electron/src/main.js — prepend common bin dirs to PATH when spawning the Python backend so child processes resolve node.
  • tests/test_weixin_more.py — cover full node-path resolution, Homebrew fallback, _MEIPASS path, and the missing-node error status.

Verification

  • make check — 828 passed, coverage 92.78% (≥90 gate)
  • Frontend gate — ESLint clean, Prettier clean, 12 tests pass, build:check OK

🤖 Generated with Claude Code

GUI-launched macOS apps inherit a minimal PATH (no Homebrew), and the
PyInstaller bundle didn't ship the node bridge, so the WeChat channel
silently failed (blank QR) in the packaged app.

- weixin_channel: resolve `node` to a full path with Homebrew/usr fallbacks;
  load the bridge from sys._MEIPASS when frozen; surface missing-node and
  bridge start failures as an `error` status instead of failing silently
- Makefile + taskboard.spec: bundle channels/weixin_bridge via --add-data
- electron main: prepend common bin dirs to PATH when spawning the backend
- tests: cover node-path resolution, Homebrew fallback, _MEIPASS path,
  and the missing-node error status

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agentforge-landing Ready Ready Preview, Comment Jun 7, 2026 6:43am

@hetaoBackend

Copy link
Copy Markdown
Owner Author

@claude please review it

@hetaoBackend hetaoBackend merged commit c1c4162 into main Jun 7, 2026
4 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.

1 participant