Skip to content

Conversation

@Soulter
Copy link
Member

@Soulter Soulter commented Jan 17, 2026

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

增强内容:

  • 修改历史记录保存逻辑,仅忽略最初的系统消息,并将后续的系统消息包含在已存储的历史记录中。
Original summary in English

Summary by Sourcery

Enhancements:

  • Change history saving logic to ignore only the initial system message and include later system messages in stored history.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 17, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些总体反馈:

  • 新增的 got_first_system 标志可以正确保留后续的 system 消息,但它的意图不是特别直观——可以考虑用一个更清晰的名字(例如 skipped_initial_system),以及/或者加上一条简短注释,说明为什么只将第一条 system 消息排除在历史记录之外。
给 AI 代理的提示
Please address the comments from this code review:

## Overall Comments
- The new `got_first_system` flag correctly preserves later system messages, but its intent isn’t immediately obvious—consider a slightly clearer name (e.g. `skipped_initial_system`) and/or a brief comment explaining why only the first system message is excluded from history.

Sourcery 对开源项目免费 —— 如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进之后的审查。
Original comment in English

Hey - I've left some high level feedback:

  • The new got_first_system flag correctly preserves later system messages, but its intent isn’t immediately obvious—consider a slightly clearer name (e.g. skipped_initial_system) and/or a brief comment explaining why only the first system message is excluded from history.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `got_first_system` flag correctly preserves later system messages, but its intent isn’t immediately obvious—consider a slightly clearer name (e.g. `skipped_initial_system`) and/or a brief comment explaining why only the first system message is excluded from history.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@dosubot dosubot bot added the area:core The bug / feature is about astrbot's core, backend label Jan 17, 2026
@Soulter Soulter changed the title feat: skip saving the first system message in history feat: skip saving head system messages in history Jan 17, 2026
@Soulter Soulter merged commit 844773a into master Jan 17, 2026
5 checks passed
@Soulter Soulter deleted the fix/system-partt branch January 17, 2026 10:02
@Soulter
Copy link
Member Author

Soulter commented Jan 17, 2026

已经在 73fca5d 修改为只跳过第一个 system message

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

Labels

area:core The bug / feature is about astrbot's core, backend 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