Repository navigation
fix(nacos-starter): only build the Nacos prompt ReActAgent when Nacos prompts are enabled - #3994
Merged
jujn merged 2 commits intoNov 5, 2026
Conversation
… prompts are enabled agentscope-ai#1709 made the Nacos auto-configurations opt-in but left AgentscopeNacosReActAgentAutoConfiguration on matchIfMissing = true. Without agentscope.nacos.prompt.enabled it registered a ReActAgent that needs the NacosPromptListener of the disabled prompt configuration, and it displaced the core starter's ReActAgent, so getting the agent failed with an UnsatisfiedDependencyException.
jujn
approved these changes
Nov 5, 2026
chickenlj
pushed a commit
that referenced
this pull request
Nov 13, 2026
… prompts are enabled (#3994) Backport the verified fix to the 2.0.x implementation and retain its existing public contracts where the upstream kernel differs. (cherry picked from commit 22ae4dd) Backport-review-patch: e1e777144e3581eb0e623a911a8861c99b52d1a0 Constraint: No AgentScope Service or SDK migration Confidence: high Not-tested: Whole-repository verification pending after lane integration
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.
AgentScope-Java Version
2.1.0-SNAPSHOT (main)
Description
问题
#1709(Fixes #1707)把 Nacos Starter 的自动配置统一改成需要显式开启(
matchIfMissing = false),其中包括AgentscopeNacosPromptAutoConfiguration。但AgentscopeNacosReActAgentAutoConfiguration没有跟着改,仍是matchIfMissing = true。这样一来,没配agentscope.nacos.prompt.enabled时:nacosPromptReActAgent。这个 bean 必须注入NacosPromptListener,而NacosPromptListener只在 prompt 开启时才有;AgentscopeAutoConfiguration之前,并且带@ConditionalOnMissingBean(ReActAgent.class),于是核心 starter 的agentscopeReActAgent被跳过。结果是:classpath 上只要有 Nacos Starter(比如只用它做 A2A 注册),配了
agentscope.agent.enabled=true的应用一取ReActAgent就报错:UnsatisfiedDependencyException: No qualifying bean of type 'NacosPromptListener'。A2A Starter 会在启动时取 agent 名生成卡片,所以应用直接起不来。改动
AgentscopeNacosReActAgentAutoConfiguration改为matchIfMissing = false,和AgentscopeNacosPromptAutoConfiguration保持一致:只有agentscope.nacos.prompt.enabled=true时才用 Nacos 的提示词装配ReActAgent,否则交给核心 starter。开启 prompt 时的行为不变。测试
新增
AgentscopeNacosReActAgentAutoConfigurationTest,同时加载 Nacos Prompt、Nacos ReActAgent 和核心 starter 三个自动配置,并提供一个Model,配置agentscope.agent.enabled=true:ReActAgent来自核心 starter(agentscopeReActAgent),没有nacosPromptReActAgent。在 main 上先确认失败,报的正是上面那个UnsatisfiedDependencyException;修复后通过。ReActAgent来自nacosPromptReActAgent,系统提示词取自 Nacos(防回归,main 上同样通过)。Nacos Starter 模块共 38 个测试全部通过。本地(JDK 17,macOS):
mvn -B -T1C clean verify99 个模块全部通过(12,088 个测试,0 失败,225 跳过)。改动只是注解上的一个值,没有新增可执行行。Related to #1707, #1709
Part of #3990