fix: apply max_agent_step config to subagents#5608
Merged
Conversation
Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix tool call limit for subagent functionality
fix: apply max_agent_step config to subagents
Mar 1, 2026
…nctionToolExecutor
|
Documentation Updates 1 document(s) were updated by changes in this PR: pr4697的改动View Changes@@ -173,13 +173,13 @@
##### 工具调用轮数上限配置(PR #5608)
-[PR #5608](https://github.com/AstrBotDevs/AstrBot/pull/5608) 修复了子代理未正确继承用户配置的工具调用轮数上限的问题([Issue #5595](https://github.com/AstrBotDevs/AstrBot/issues/5595))。修复前,子代理始终使用硬编码的 30 步上限,忽略了用户在"工具调用轮数上限"(`provider_settings.max_agent_step`)中的配置,而主代理能够正确遵循该配置。
-
-修复后,子代理与主代理行为保持一致:
+[PR #5608](https://github.com/AstrBotDevs/AstrBot/pull/5608) 修复了子代理未正确继承用户配置的工具调用轮数上限的问题([Issue #5595](https://github.com/AstrBotDevs/AstrBot/issues/5595))。在此修复之前,子代理始终使用硬编码的 30 步上限,忽略了用户在"工具调用轮数上限"(`provider_settings.max_agent_step`)中的配置,而主代理能够正确遵循该配置。
+
+该修复现已实施,子代理与主代理行为保持一致:
- 子代理执行时,`max_steps` 参数从系统配置 `provider_settings.max_agent_step` 读取(默认值为 30)
- 用户可通过桌面应用 → 配置文件 → 普通配置 → AI 配置页面,统一设置主代理和子代理的工具调用轮数上限
-- 确保子代理在执行长自动化任务时不会因硬编码上限而提前终止
+- 子代理在执行长自动化任务时不再因硬编码上限而提前终止,而是遵循用户配置的上限值
##### 参考图片自动传递(PR #5579)
|
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.
Sub-agents ignored the user-configured "工具调用轮数上限" (
provider_settings.max_agent_step) and always capped tool calls at 30 steps, while the main agent correctly respected the configured value.Change
astrbot/core/astr_agent_tool_exec.py: Replace hardcodedmax_steps=30in the subagent handoff call with a config lookup, consistent with howstreamis already read in the same call:Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.