Skip to content

fix(weixin): deliver files and videos to local and remote Agent sessions - #3645

Merged
bobleer merged 5 commits into
GCWing:mainfrom
bobleer:bob/fix-weixin-inbound-files
Oct 31, 2026
Merged

bobleer merged 5 commits into
GCWing:mainfrom
bobleer:bob/fix-weixin-inbound-files

Conversation

@bobleer

@bobleer bobleer commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Problem and behavior

Ordinary WeChat files and native videos were ignored, so sending a .pem or video could submit an empty message to the Agent. Image download failures could also submit empty/partial input, and subsequent text could overtake a media download.

Receive and decrypt file_item and video_item attachments through the existing CDN protocol, save their unchanged bytes through the session-selected filesystem, and include the completed file path in the turn. Native videos arrive as .mp4 files; video interpretation depends on the Agent's tools. The decoder distinguishes plaintext file lengths from ciphertext video_size and bounds each message to five files totaling 30 MiB.

Files use unique directories, sanitized names, and POSIX 0700/0600 permissions without overwriting workspace files. Failed media, unavailable workspaces, and pending-interaction conflicts produce visible errors. Per-peer ingress preserves receive order through media preparation and turn admission, then releases before model output or interactive replies. Queued input stays fenced to its account identity. Raw voice without transcripts and empty text receive an explicit notice; voice transcripts remain supported.

Cross-device bot sessions negotiate session_attachments_v1 and transfer bytes through the existing encrypted device RPC lane. The execution host resolves the session workspace and returns its own path. Older targets explicitly request an upgrade. The additive wire command supports session-scoped, content-checked retries without overwrites; Debug logs exclude attachment contents. SSH workspaces use their selected filesystem and never fall back to local IO.

Validation

  • Focused service/provider/storage and Core bot/session-routing tests passed with minimum remote-connect features. The final native-video change passed 28 provider tests, 27 WeChat orchestration tests, and the i18n audit.
  • The encrypted Socket.IO relay fixture covers new/legacy capability negotiation, binary attachment upload, execution-host paths, submission acknowledgement before model completion, reconnection, and remote interactive replies.
  • Other fixtures cover CDN decryption and size bounds, native-video byte preservation and ciphertext-size semantics, local private storage, simulated POSIX remote storage, offline/no-local-fallback, symlink rejection, retry/conflict behavior, legacy wire round trips, missing-session rejection, pending-answer preservation, ordered media failure handling, and stale-identity rejection.
  • pnpm run i18n:audit, pnpm run check:repo-hygiene, and git diff --check passed.
  • No live WeChat, physical SSH, Peer Device, or Detached Dispatch end-to-end run. Loopback encrypted relay and simulated remote filesystem fixtures do not establish physical-host coverage. This input path does not submit files to Detached Dispatch jobs.

Checked refreshed upstream main and open PRs (including drafts) before implementation; no existing fix covered ordinary WeChat file input. The CDN file/video behavior follows the published @tencent-weixin/openclaw-weixin sources (2.4.8 and 2.4.10).

@bobleer bobleer changed the title fix(weixin): deliver inbound files to local and remote Agent sessions fix(weixin): deliver files and videos to local and remote Agent sessions Oct 31, 2026
@bobleer
bobleer merged commit c00bbf1 into GCWing:main Oct 31, 2026
13 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