Skip to content

fix(weixin): keep short multiline content in one bubble - #7773

Closed
JnyRoad wants to merge 1 commit into
NousResearch:mainfrom
JnyRoad:fix/weixin-message-chunking
Closed

fix(weixin): keep short multiline content in one bubble#7773
JnyRoad wants to merge 1 commit into
NousResearch:mainfrom
JnyRoad:fix/weixin-message-chunking

Conversation

@JnyRoad

@JnyRoad JnyRoad commented Apr 11, 2026

Copy link
Copy Markdown

What Changed

  • keep short multiline Weixin messages in a single bubble when they fit within the platform limit
  • keep the existing block-aware fallback for oversized content so markdown and code fences still split safely
  • align the Weixin gateway tests with the new chunking behavior

Why

  • splitting every top-level newline into separate messages made short multiline replies feel fragmented in Weixin
  • when the full payload already fits, preserving one bubble gives a more readable card-like result without relaxing the size guardrails

How to Test

  • source venv/bin/activate && python -m pytest tests/gateway/test_weixin.py -q

Risk & Rollback

  • Risk level: Low
  • Rollback: revert commit 9d95974

Checklist

  • Config/env changes needed: no
  • Database migration required: no
  • API contract changes: no
  • Feature flag involved: no
  • Tests added / updated: yes

@JnyRoad
JnyRoad marked this pull request as ready for review April 11, 2026 14:54
teknium1 added a commit that referenced this pull request Apr 11, 2026
The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs #7797 (guantoubaozi), #7792 (luoxiao6645),
#7838 (qyx596), #7825 (weedge), #7784 (sherunlock03), #7773 (JnyRoad).
Core fix unanimous across all six; config toggle from #7838; inter-chunk
delay from #7825.
teknium1 added a commit that referenced this pull request Apr 11, 2026
)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs #7797 (guantoubaozi), #7792 (luoxiao6645),
#7838 (qyx596), #7825 (weedge), #7784 (sherunlock03), #7773 (JnyRoad).
Core fix unanimous across all six; config toggle from #7838; inter-chunk
delay from #7825.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via salvage PR #7903. Your contribution — short multiline single-bubble fix — was incorporated into the combined fix. All six PRs addressing this issue were synthesized into a single implementation that takes the best aspects of each. Thank you @JnyRoad for the contribution!

@teknium1 teknium1 closed this Apr 11, 2026
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…usResearch#7903)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs NousResearch#7797 (guantoubaozi), NousResearch#7792 (luoxiao6645),
NousResearch#7838 (qyx596), NousResearch#7825 (weedge), NousResearch#7784 (sherunlock03), NousResearch#7773 (JnyRoad).
Core fix unanimous across all six; config toggle from NousResearch#7838; inter-chunk
delay from NousResearch#7825.
@JnyRoad
JnyRoad deleted the fix/weixin-message-chunking branch April 14, 2026 01:54
aj-nt pushed a commit to aj-nt/hermes-agent that referenced this pull request May 1, 2026
…usResearch#7903)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs NousResearch#7797 (guantoubaozi), NousResearch#7792 (luoxiao6645),
NousResearch#7838 (qyx596), NousResearch#7825 (weedge), NousResearch#7784 (sherunlock03), NousResearch#7773 (JnyRoad).
Core fix unanimous across all six; config toggle from NousResearch#7838; inter-chunk
delay from NousResearch#7825.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…usResearch#7903)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs NousResearch#7797 (guantoubaozi), NousResearch#7792 (luoxiao6645),
NousResearch#7838 (qyx596), NousResearch#7825 (weedge), NousResearch#7784 (sherunlock03), NousResearch#7773 (JnyRoad).
Core fix unanimous across all six; config toggle from NousResearch#7838; inter-chunk
delay from NousResearch#7825.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…usResearch#7903)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs NousResearch#7797 (guantoubaozi), NousResearch#7792 (luoxiao6645),
NousResearch#7838 (qyx596), NousResearch#7825 (weedge), NousResearch#7784 (sherunlock03), NousResearch#7773 (JnyRoad).
Core fix unanimous across all six; config toggle from NousResearch#7838; inter-chunk
delay from NousResearch#7825.
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
…usResearch#7903)

The Weixin adapter was splitting responses at every top-level newline,
causing notification spam (up to 70 API calls for a single long markdown
response). This salvages the best aspects of six contributor PRs:

Compact mode (new default):
- Messages under the 4000-char limit stay as a single bubble even with
  multiple lines, paragraphs, and code blocks
- Only oversized messages get split at logical markdown boundaries
- Inter-chunk delay (0.3s) between chunks prevents WeChat rate-limit drops

Legacy mode (opt-in):
- Set split_multiline_messages: true in platforms.weixin.extra config
- Or set WEIXIN_SPLIT_MULTILINE_MESSAGES=true env var
- Restores the old per-line splitting behavior

Salvaged from PRs NousResearch#7797 (guantoubaozi), NousResearch#7792 (luoxiao6645),
NousResearch#7838 (qyx596), NousResearch#7825 (weedge), NousResearch#7784 (sherunlock03), NousResearch#7773 (JnyRoad).
Core fix unanimous across all six; config toggle from NousResearch#7838; inter-chunk
delay from NousResearch#7825.
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