Skip to content

[Bug]: Version.VERSION is hardcoded and reports a stale version (1.0.13-SNAPSHOT vs 2.0.3-SNAPSHOT) #3086

Description

@amyaxy

Describe the bug
io.agentscope.core.Version#VERSION is a hardcoded string literal that has drifted
out of sync with the actual Maven project version. As a result, the User-Agent
header sent to all model providers reports the stale version
agentscope-java/1.0.13-SNAPSHOT instead of the current 2.0.3-SNAPSHOT.

To Reproduce

import io.agentscope.core.Version;

System.out.println(Version.VERSION);          // prints 1.0.13-SNAPSHOT
System.out.println(Version.getUserAgent());   // agentscope-java/1.0.13-SNAPSHOT; ...

Compare with the version declared in pom.xml (<revision>2.0.3-SNAPSHOT</revision>).

Expected behavior
Version.VERSION should match the Maven project version, so getUserAgent() reports
the version of the artifact actually being built/released.

Environment

  • AgentScope-Java Version: 2.0.3-SNAPSHOT
  • Java Version: 21
  • OS: Windows 11

Additional context
Root cause: the version is duplicated in three places that must be manually kept in
sync — pom.xml <revision>, Version.java VERSION, and
VersionTest#testVersionConstant. Proposed fix: make ${project.version} the single
source of truth and inject it at build time via Maven resource filtering (add a
version.properties, read it lazily from Version, and cross-check it in VersionTest).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreCore library: agentscope-core (general)bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions