Skip to content

Add NacosSkillRepository#902

Open
qiacheng7 wants to merge 9 commits intoagentscope-ai:mainfrom
qiacheng7:main
Open

Add NacosSkillRepository#902
qiacheng7 wants to merge 9 commits intoagentscope-ai:mainfrom
qiacheng7:main

Conversation

@qiacheng7
Copy link

提供 NacosSkillRepository,实现 AgentSkillRepository,从 Nacos 读取 Skill(只读)

@qiacheng7 qiacheng7 requested a review from a team March 10, 2026 01:51
@cla-assistant
Copy link

cla-assistant bot commented Mar 10, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant
Copy link

cla-assistant bot commented Mar 10, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shiyiyue1102
Copy link
Contributor

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

sign CLA pls.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new Nacos-backed AgentSkillRepository implementation so AgentScope can read Skills from Nacos (read-only), and wires the new module into the build/distribution BOMs.

Changes:

  • Add new agentscope-extensions-nacos-skill module implementing NacosSkillRepository and a SkillAgentSkill converter.
  • Register the new module in the Nacos extensions parent POM and include it in the BOM and agentscope-all distribution.
  • Update the managed nacos-client version in the dependencies BOM.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
agentscope-extensions/agentscope-extensions-nacos/pom.xml Adds the new agentscope-extensions-nacos-skill module to the reactor build.
agentscope-extensions/agentscope-extensions-nacos/agentscope-extensions-nacos-skill/src/main/java/io/agentscope/core/nacos/skill/NacosSkillToAgentSkillConverter.java Introduces conversion logic from Nacos AI Skill model to AgentSkill.
agentscope-extensions/agentscope-extensions-nacos/agentscope-extensions-nacos-skill/src/main/java/io/agentscope/core/nacos/skill/NacosSkillRepository.java Adds the Nacos-based repository implementation for loading skills.
agentscope-extensions/agentscope-extensions-nacos/agentscope-extensions-nacos-skill/pom.xml Declares the new skill module artifact and dependencies.
agentscope-distribution/agentscope-bom/pom.xml Adds the new artifact to the AgentScope BOM.
agentscope-distribution/agentscope-all/pom.xml Includes the new module as an optional dependency in the “all” distribution.
agentscope-dependencies-bom/pom.xml Bumps the managed nacos-client version used across the repo.

Comment on lines +114 to +122
@Override
public void setWriteable(boolean writeable) {
this.writeable = writeable;
}

@Override
public boolean isWriteable() {
return writeable;
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

setWriteable() and isWriteable() expose a mutable writeable flag, but this repository still throws UnsupportedOperationException for save/delete and listing methods. This can mislead callers into attempting writes based on getRepositoryInfo().isWritable()/isWriteable(). Consider making the repository explicitly read-only (ignore setWriteable, always return false for isWriteable, and ensure repository info matches), or implement the corresponding write/list operations when writeable is enabled.

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +147
@Override
public List<String> getAllSkillNames() {
throw new UnsupportedOperationException(
"getAllSkillNames is not implemented for NacosSkillRepository");
}

@Override
public List<AgentSkill> getAllSkills() {
throw new UnsupportedOperationException(
"getAllSkills is not implemented for NacosSkillRepository");
}

@Override
public boolean save(List<AgentSkill> skills, boolean force) {
throw new UnsupportedOperationException("save is not implemented for NacosSkillRepository");
}

@Override
public boolean delete(String skillName) {
throw new UnsupportedOperationException(
"delete is not implemented for NacosSkillRepository");
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

For read-only repositories in this codebase, write/list operations are typically implemented as no-ops that log a warning and return false/empty results (e.g., GitSkillRepository and ClasspathSkillRepository), rather than throwing UnsupportedOperationException. Throwing here can cause unexpected crashes for callers that iterate repositories uniformly. Consider returning Collections.emptyList() for list methods and false for save/delete, with a warn log indicating the repository is read-only.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +85
@Override
public AgentSkill getSkill(String name) {
if (name == null || name.isBlank()) {
throw new IllegalArgumentException("Skill name cannot be null or empty");
}
try {
Skill nacosSkill = aiService.loadSkill(name.trim());
if (nacosSkill == null) {
throw new IllegalArgumentException("Skill not found: " + name);
}
return NacosSkillToAgentSkillConverter.toAgentSkill(nacosSkill, getSource());
} catch (NacosException e) {
if (e.getErrCode() == NacosException.NOT_FOUND) {
throw new IllegalArgumentException("Skill not found: " + name, e);
}
throw new RuntimeException("Failed to load skill from Nacos: " + name, e);
}
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This new repository/converter module doesn’t appear to include tests. The Nacos extensions already have unit tests (e.g., nacos-a2a and nacos-prompt), so adding tests here would help prevent regressions around getSkill() error handling and the Nacos→AgentSkill conversion (defaults for blank fields, resource mapping).

Copilot uses AI. Check for mistakes.
Comment on lines +29 to +31
<artifactId>agentscope-extensions-nacos-skill</artifactId>
<name>AgentScope Java - Nacos A2A skill</name>
<description>agentscope-extensions-nacos-skill</description>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The Maven <name> looks like a copy/paste from the A2A module ("Nacos A2A skill"). Since this artifact is a skill repository integration, consider renaming it to something like "AgentScope Java - Nacos Skill Repository" to avoid confusion in published artifacts.

Copilot uses AI. Check for mistakes.
Comment on lines 103 to 107
<quartz.version>2.5.2</quartz.version>
<spring.version>7.0.3</spring.version>
<spring-boot.version>4.0.3</spring-boot.version>
<nacos-client.version>3.1.1</nacos-client.version>
<nacos-client.version>3.2.0-BETA</nacos-client.version>
<json-schema-validator.version>3.0.0</json-schema-validator.version>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Updating the BOM-managed nacos-client.version to a beta release will affect all modules consuming com.alibaba.nacos:nacos-client (e.g., existing Nacos A2A / prompt integrations). Please confirm compatibility across those modules, or consider scoping the newer version to just the new skill module if only it requires newer APIs.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants