Skip to content

feat(longtext): implement long text splitting strategy with Markdown …#2038

Open
fdc310 wants to merge 2 commits into
masterfrom
feat/long-text-split
Open

feat(longtext): implement long text splitting strategy with Markdown …#2038
fdc310 wants to merge 2 commits into
masterfrom
feat/long-text-split

Conversation

@fdc310

@fdc310 fdc310 commented Mar 8, 2026

Copy link
Copy Markdown
Member

…awareness

概述 / Overview

请在此部分填写你实现/解决/优化的内容:
Summary of what you implemented/solved/optimized:

新增回复消息切割为多条消息回复逻辑

更改前后对比截图 / Screenshots

请在此部分粘贴更改前后对比截图(可以是界面截图、控制台输出、对话截图等):
Please paste the screenshots of changes before and after here (can be interface screenshots, console output, conversation screenshots, etc.):

修改前 / Before:

修改后 / After:

检查清单 / Checklist

PR 作者完成 / For PR author

请在方括号间写x以打勾 / Please tick the box with x

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 与项目所有者沟通过了吗? / Have you communicated with the project maintainer?
  • 我确定已自行测试所作的更改,确保功能符合预期。 / I have tested the changes and ensured they work as expected.

项目维护者完成 / For project maintainer

  • 相关 issues 链接了吗? / Have you linked the related issues?
  • 配置项写好了吗?迁移写好了吗?生效了吗? / Have you written the configuration items? Have you written the migration? Has it taken effect?
  • 依赖加到 pyproject.toml 和 core/bootutils/deps.py 了吗 / Have you added the dependencies to pyproject.toml and core/bootutils/deps.py?
  • 文档编写了吗? / Have you written the documentation?

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. eh: Feature enhance: 新功能添加 / add new features m: Session 会话和消息模块 / Sessions management labels Mar 8, 2026
quote_origin=quote_origin,
is_final=is_final,
)
if len(query.resp_message_chain) > 1:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里query.resp_message_chain是不清空的?如果一个query里回复了好几条消息,会导致它重复发好几遍吧?比如在用户一个消息发过来时,local-agent执行了好几轮,那么每一轮都会产生一个回复,每个回复又会被split成好几份;原来的逻辑是只发最后一个resp_message_chain,一个message_chain不会被分割,就没有问题,但现在加了分割,可能就会有问题吧?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query里为什么会回复好几条消息呢,有一点没有理解到,是相当于在群里,同时好几个人进行询问吗

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

工具调用啊,agent循环,比如我让它去查询一个数据表,他就会回复:

1. 调用工具前回复一条“我将要调用工具”
2. 调用工具的记录一条
3. 完成后根据工具返回值回复“我查到了xxxx”

这样一次用户消息就有好几条回复的

Use query variable '_longtext_split_extra_chains' to pass extra split
segments instead of appending to resp_message_chain directly. This
prevents agent tool-call multi-round responses from being misidentified
as split results and sent repeatedly.

respback.py reverts to original single-chain logic and appends split
extra chains after the main response.
@RockChinQ

Copy link
Copy Markdown
Member

recheck

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! ❤️ Before we can merge this pull request, we need you to sign the LangBot Contributor License Agreement (CLA). You keep full copyright of your code — the CLA grants us a license to use and distribute your contribution. Signing takes 10 seconds and covers all repositories in this organization, permanently.

感谢您的贡献!合并前请阅读并签署贡献者许可协议(CLA)。您保留代码的全部版权,签署仅需回复下方指定内容,一次签署对本组织全部仓库永久有效。


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (RockChinQ)[https://github.com/RockChinQ]
@fdc310
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eh: Feature enhance: 新功能添加 / add new features m: Session 会话和消息模块 / Sessions management size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants