Skip to content

[codex] Add forwarded chat record expansion#15

Open
ZaychikLiu wants to merge 1 commit into
huohuoer:mainfrom
ZaychikLiu:codex/expand-forwarded-records
Open

[codex] Add forwarded chat record expansion#15
ZaychikLiu wants to merge 1 commit into
huohuoer:mainfrom
ZaychikLiu:codex/expand-forwarded-records

Conversation

@ZaychikLiu
Copy link
Copy Markdown

@ZaychikLiu ZaychikLiu commented May 29, 2026

Summary

Adds a wechat-cli records command for expanding WeChat forwarded / merged chat record cards into their inner messages, including nested forwarded records.

The command scans app messages that contain compressed WCDB payloads, decompresses them with the existing message decompression helper, parses <recorditem> / <dataitem> entries, and exports the nested items as either text or JSON.

Contribution

This contribution was developed collaboratively by Zaychik and Codex. The commit includes Co-authored-by trailers for both contributors so the authorship is visible in GitHub history.

Why

Merged chat records currently appear as a single link/file-style app message in exported history, so the original messages inside the merged record are not visible. This makes exports incomplete for conversations that rely on forwarded chat bundles.

User Impact

  • New command:
    wechat-cli records "CONTACT" --limit 20 --format text --output records.txt
  • Nested forwarded records are parsed automatically and emitted as children in JSON.
  • Supports JSON output for scripting / AI-agent workflows.
  • Supports --limit, --offset, --scan-limit, --start-time, and --end-time.
  • Keeps existing history behavior unchanged.
  • Documents the new command in both English and Chinese READMEs.

Validation

  • .venv/bin/python -m compileall wechat_cli
  • .venv/bin/python entry.py --help
  • .venv/bin/python entry.py records --help
  • Synthetic nested forwarded-record parser smoke test, including <dataitemsourceid> tags that should not be treated as records.
  • Local macOS WeChat smoke test:
    entry.py --config /path/to/config.json records "wxid_..." --limit 2 --format text --output wechat-cli-records-smoke.txt
  • Local JSON smoke test:
    entry.py --config /path/to/config.json records "wxid_..." --limit 1 --format json --output wechat-cli-records-smoke.json

Notes

The parsing is intentionally conservative: it only expands records where the decompressed payload contains recognizable record/data item markup, and falls back to available title/description fields for non-text inner message types.

Co-authored-by: Feiyang Liu <a160130k@gmail.com>

Co-authored-by: Codex <codex@openai.com>
@ZaychikLiu ZaychikLiu marked this pull request as ready for review May 29, 2026 16:30
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