Skip to content

fix(localagent): stop re-seeding stream accumulator with previous rou…#2329

Open
MIKAZE3 wants to merge 1 commit into
langbot-app:masterfrom
MIKAZE3:fix/localagent-duplicate-message
Open

fix(localagent): stop re-seeding stream accumulator with previous rou…#2329
MIKAZE3 wants to merge 1 commit into
langbot-app:masterfrom
MIKAZE3:fix/localagent-duplicate-message

Conversation

@MIKAZE3

@MIKAZE3 MIKAZE3 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

…nd content

When the LLM (e.g. MiniMax-M3) returns multiple rounds after tool calls, the _StreamAccumulator was initialized with initial_content=first_content, causing every subsequent round to repeat the entire first message. Remove the re-seeding so each round starts with a clean accumulator.

概述 / 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:

image

修改后 / After:

image

检查清单 / Checklist

PR 作者完成 / For PR author

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

  • 阅读仓库贡献指引了吗? / Have you read the contribution guide?
  • 我已签署或将在机器人提示后签署 CLA。 / I have signed, or will sign when prompted by the bot, the CLA.
  • 与项目所有者沟通过了吗? / 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:XS This PR changes 0-9 lines, ignoring generated files. bug? Bug或Bug修复相关 / maybe a bug labels Jul 10, 2026

@dadachann dadachann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个拆分粒度没问题,但分支已与 master 冲突,且 localagent.py 最近有后续改动。请 rebase 后补一个多轮 tool call 内容不重复的回归测试,再继续 review。

@MIKAZE3
MIKAZE3 force-pushed the fix/localagent-duplicate-message branch from d6728a8 to 17f59b4 Compare July 16, 2026 09:18
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MIKAZE3
MIKAZE3 requested a review from dadachann July 17, 2026 04:34
…nd content

When the LLM (e.g. MiniMax-M3) returns multiple rounds after tool calls, the _StreamAccumulator was initialized with initial_content=first_content, causing every subsequent round to repeat the entire first message. Remove the re-seeding so each round starts with a clean accumulator.

Add regression test verifying multi-round tool call content is not duplicated.
@MIKAZE3
MIKAZE3 force-pushed the fix/localagent-duplicate-message branch from 17f59b4 to 46f6b57 Compare July 17, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug? Bug或Bug修复相关 / maybe a bug size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants