agentscope-ai / agentscope-ai/agentscope-java

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

未關閉
#3,086 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/core bug
主要語言
Java
星號
5.6k
分支
1.3k
平均合併
4 天 12 小時
30 天內合併 PR
77

描述

**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**
```java
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` (`2.0.3-SNAPSHOT`).

**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` ``, `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`).

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。