Skip to content

fix(mcp): bound image uploads and expose bridge diagnostics#210

Open
lizhong1989 wants to merge 1 commit into
wechatsync:v2from
lizhong1989:fix/cli-bridge-timeouts
Open

fix(mcp): bound image uploads and expose bridge diagnostics#210
lizhong1989 wants to merge 1 commit into
wechatsync:v2from
lizhong1989:fix/cli-bridge-timeouts

Conversation

@lizhong1989

Copy link
Copy Markdown

Summary

  • bound uploadImage and uploadImage:complete requests to a dedicated 60-second timeout
  • expose Primary bridge PID, start time, and uptime through /status
  • show Primary process diagnostics when a Secondary CLI instance times out
  • reject pending requests when the bridge stops
  • document WECHATSYNC_UPLOAD_TIMEOUT

Why

A platform adapter can leave uploadImage(blob) pending indefinitely. The CLI processes local images sequentially, so one stuck upload blocked the entire sync until the bridge-wide six-minute timeout.

Separately, when an old Primary process still owned ports 9527/9528 but the extension was disconnected, new CLI instances could only report a generic connection error. Exposing process diagnostics makes the stale owner identifiable without introducing unsafe automatic process termination.

Closes #208.
Partially addresses #207. A safe reset/takeover mechanism still needs an ownership or heartbeat design.

Tests

  • corepack yarn workspace @wechatsync/mcp-server build
  • corepack yarn workspace @wechatsync/cli build
  • corepack yarn workspace @wechatsync/mcp-server test

Added coverage for:

  • Primary status diagnostics
  • bounded image upload timeout
  • rejection of pending requests during bridge shutdown

All 3 tests pass on Windows 11 / Node.js 24.14.0.

Compatibility

  • syncArticle keeps the existing six-minute timeout.
  • Existing /status fields remain unchanged; new fields are additive.
  • The default upload timeout can be overridden with WECHATSYNC_UPLOAD_TIMEOUT.

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.

[Bug] 本地图片上传不返回时 CLI 最长等待 6 分钟且无法取消

1 participant