#15878·nacos

[Copilot] Upgrade AgentScope Java dependency to 2.0.3

Author: neoLsHCreated Sep 24, 2026Updated Sep 24, 2026

Is your feature request related to a problem? Please describe.

The Copilot module (nacos-copilot) depends on AgentScope Java 1.0.7. AgentScope Java 2.0 is out and introduces API-level breaking changes (see its V1→V2 migration guide). In the multi-provider discussion #15757, @KomachiSion agreed the 2.0 upgrade should land as its own PR first, before the provider-extension work, so it stays small and reviewable. This issue tracks that upgrade.

Describe the solution you'd like

A single behavior-preserving dependency upgrade:

  • Bump agentscope-core and agentscope-extensions-studio from 1.0.7 to 2.0.3.
  • Handle the only mandatory migration for the current DashScope-only code — A.3 (model providers moved out of core): add agentscope-extensions-model-dashscope:2.0.3 and move the DashScopeChatModel import to io.agentscope.extensions.model.dashscope.
  • Add a small test covering the Msg construction shapes Copilot uses, since 2.0 validates content against role at construction time (A.6).
  • Keep runtime behavior unchanged: still DashScope-only, still on stream().

Out of scope (separate follow-ups under #15757): the stream() → streamEvents() migration (soft-deprecated but retained through 2.0.x), multi-provider support, and the credential/config redesign.

Describe alternatives you've considered

Bundling the upgrade together with multi-provider support in one PR — rejected in #15757 to keep the dependency bump atomic and easy to review. Migrating stream() → streamEvents() in the same PR — deferred, since it changes the event types and deserves its own verification of message/text-delta/thinking/end/error events and Studio integration.

Additional context

Refs #15757