agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

Fix Nacos skill marketplace latest label resolution

Open lancefoever opened this issue 5 months ago • 2 comments

AgentScope-Java Version

main branch

Description

Background

When using the Builder Nacos marketplace, skill preview/install can fail while loading a skill version detail.

The previous implementation passed the label name LATEST directly as the version argument to getSkillVersionDetail(namespaceId, skillName, version). However, the Nacos skill version detail API expects the actual skill version value, not the label name.

This could produce a request equivalent to:

/nacos/v3/admin/ai/skills/version?skillName=<skillName>&namespaceId=<namespaceId>&version=LATEST

Nacos then returns an error similar to:

Skill version not found: <skillName>@LATEST

Purpose

This PR fixes Nacos-backed Builder marketplace preview/install by resolving the real skill version from the skill metadata labels before loading the skill version detail.

Changes Made

  • Load skill metadata through the Nacos maintainer client.
  • Resolve the actual skill version from the LATEST label in the skill metadata.
  • Use the resolved version value when calling getSkillVersionDetail(...).
  • Add validation so a clear error is raised if the LATEST label cannot be resolved.

How to Test

  1. Start a Nacos server with Skill Registry support.
  2. Create or publish a Nacos skill with a LATEST label pointing to an online skill version.
  3. Add the Nacos marketplace in Builder.
  4. Preview the Nacos skill from Builder.
  5. Install the skill into an agent.

Expected result:

  • Builder no longer requests skill details with version=LATEST.
  • Builder resolves the actual skill version from Nacos skill metadata.
  • Skill preview succeeds.
  • Skill installation succeeds.
  • The installed skill appears in the agent's skills list.

Local validation:

mvn -q -pl agentscope-examples/agents/agentscope-builder -am spotless:apply
mvn -q -pl agentscope-examples/agents/agentscope-builder -am -DskipTests compile

Checklist

Please check the following items before code is ready to be reviewed.

  • [x] Code has been formatted with mvn spotless:apply
  • [ ] All tests are passing (mvn test)
  • [ ] Javadoc comments are complete and follow project conventions
  • [ ] Related documentation has been updated (e.g. links, examples, etc.)
  • [x] Code is ready for review

lancefoever avatar Jun 04 '26 02:06 lancefoever

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 04 '26 02:06 CLAassistant

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Jun 04 '26 02:06 codecov[bot]