fix: respect session plugin filters in cron agents - #10163
Merged
Soulter merged 3 commits intoSep 21, 2026
Merged
Conversation
wcqqq1214
marked this pull request as ready for review
September 20, 2026 18:12
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the session plugin policy is applied incorrectly, cron agents could invoke plugins or response hooks that the session disabled, potentially triggering unintended external actions. Reverting prevents future misfiltered runs, but any actions already performed by an incorrectly enabled plugin cannot be undone.
Soulter
approved these changes
Sep 21, 2026
9 tasks
BegoniaHe
added a commit
to Xero-Team/AstrBot
that referenced
this pull request
Sep 21, 2026
Apply the session plugin_set filter to the fork-only background-wake event in astr_agent_tool_exec.py and the BTW work event in btw/submission.py, matching the cron agent fix from AstrBotDevs#10163. Without it, background and BTW agent runs could invoke plugin hooks and tools that the session config had excluded. Related: AstrBotDevs#10163 Tested: uv run pytest --test-profile blocking -q AI-Generated: true Generated-At: 2026-09-21T17:45:06Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10161. Cron agents skipped session plugin filtering, allowing disabled plugins to run hooks and expose LLM tools.
Modifications / 改动点
Initialize
CronMessageEvent.plugins_namefrom the session'splugin_set, matching normal message handling. Add regression tests for whitelist, empty, wildcard, and default configurations.Documentation: this backend-only fix does not change WebUI navigation, page structure, or labels. No updates to
docs/zh,docs/en, or screenshots are needed, and no entry-point mapping or related changelog update applies.Screenshots or Test Results / 运行截图或测试结果
Verified with the actual
astrbot_plugin_nobrowser_markdown_to_picv1.6.1 inllmmode: an excluded plugin generated an image before the fix, but neither ran its hook nor exposed its tool afterward. Explicitly enabling it still produced an image. Used fixed model output and captured delivery locally; no live QQ test.Checklist / 检查清单
😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
/ 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。
👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
/ 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。
📚 I checked the affected WebUI instructions and screenshots in
docs/zhanddocs/enagainst the changed navigation, page structure, and labels, and updated them in this PR (or explained why no documentation update is needed). For renamed, moved, or merged entry points, I included an old entry → new entry mapping in the documentation and changelog./ 我已对照变化后的 WebUI 入口、页面结构和术语,核对并在本 PR 中更新
docs/zh和docs/en的相关操作说明与截图(或说明无需更新文档的原因)。入口改名、移动或合并时,已在文档和 changelog 中补充 旧入口 → 新入口 对照。🤓 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.txtandpyproject.toml./ 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到
requirements.txt和pyproject.toml文件相应位置。😮 My changes do not introduce malicious code.
/ 我的更改没有引入恶意代码。
Summary by Sourcery
Respect session plugin policies when executing cron agents.
Bug Fixes:
Tests: