Skip to content

微信:接龙重建加条数和总长上限,第一行写明条数 - #66

Merged
NginxL merged 2 commits into
mainfrom
fix/wechat-note-limits
Dec 6, 2026
Merged

NginxL merged 2 commits into
mainfrom
fix/wechat-note-limits

Conversation

@NginxL

@NginxL NginxL commented Dec 6, 2026

Copy link
Copy Markdown
Owner

做了什么

修 #65 合入后 review 提出的两个 P1(P2 这次不改)。

P1-1:接龙重建没有上限(native/matewechat-native/src/message.rs)

  • 条目数上限 200(与上游 agent-wechat group_notes.rs 的 MAX_ENTRIES 一致):超过就不重建,原样用 <title>。
  • 总长上限沿用 NOTE_TITLE_MOST(128 KB):重建时边拼边检查,超过就放弃重建,原样用 <title>。之前一条特制消息可以让每个条目都引用 16 KB 的同一段,条目数不限,放大到几十上百 MB。
  • 原生组件升到 0.1.13。

P1-2:长接龙在 /agent 上下文里被截断,助手不知道

  • 接龙第一行改成「[接龙] 共 N 条」,下面是标题和完整名单。按结构重建时 N 是条目数;用 <title> 原文时(以及 AgentWechat 模式下用正文时)N 是「1. 」这样的编号行数;数不出来就不写条数。
  • assistant/instructions.md:/agent 附带的聊天记录里长消息会截断、末尾是「…」;接龙以「…」结尾或数到的条数和「共 N 条」对不上时,用 matewechat_messages 读全文。
  • core 的截断长度(2000 字)没改。

怎么验证的

  • cargo test --locked(native/matewechat-native):23 个通过。新增 group_note_too_many_entries_shows_its_title(200 条重建、201 条退回 title)、group_note_cannot_grow_past_a_title(16 KB title、每条引用整段:7 条放得下、8 条退回 title;200 条退回 title)、numbered_lines_of_a_note。去掉两处上限后这两个新测试失败,确认它们在旧代码上会挂。
  • bash scripts/test.sh:core 950、feishu 419 通过;wechat 191 里只有 test_the_pinned_program_is_the_version_of_its_source 失败——它要求 install.py 钉的程序版本等于源码版本,发版提交里编好 0.1.13 并钉上后通过。
  • test_hub.py:AgentWechat 模式的接龙带「共 N 条」;「说明 3. 不算」「12345. 也不算」这样的行不计数。

没做什么

  • review 里的 P2 都没改。
  • 没改 core 的截断长度,没改其他功能。
  • 已经入库的旧接龙消息不回填,第一行不会补上条数。

🤖 Generated with Claude Code

NginxL and others added 2 commits December 6, 2026 12:55
A note's list is rebuilt from its parts only up to 200 entries (agent-wechat's
MAX_ENTRIES) and only while the rebuilt text stays within the size a note's
<title> may have; past either cap the note is shown as its <title>. One crafted
message could otherwise repeat a 16 KB range per entry without limit.

The first line now reads "[接龙] 共 N 条", so a note clipped in an /agent
request's history shows it is incomplete; the assistant's instructions say to
read it whole with matewechat_messages then. The history's clipping length is
unchanged.

matewechat-native 0.1.13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matewechat-native 0.1.13(tag matewechat-native-v0.1.13,SHA-256
538603677ac30d5675f3093e6907b65fac3a20877bf126a8942fdbc850fb46fb)。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NginxL
NginxL merged commit 58f6414 into main Dec 6, 2026
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