agentscope-ai / agentscope-ai/agentscope-java

[Bug]:agentscope-service: frontend/src/features/build/ 目录中文件被gitignore中build/排除,导致页面未提交至代码库

Đang mở
#2,738 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area/build bug
Ngôn ngữ chính
Java
Star
5.6k
Fork
1.3k
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
77

Mô tả

Bug 描述

agentscope-service 前端目录 frontend/src/features/build/ 下的源代码从未被提交到 git 仓库。根目录 .gitignore 中存在一条通用的 build/ 忽略规则(原本用于忽略
Gradle/Java 的构建输出目录),它会匹配仓库中任意名为 build 的目录,包括前端源码目录 src/features/build/。虽然 .gitignore 为 Java 路径添加了
!**/src/main/**/build/ 和 !**/src/test/**/build/ 例外,但没有为前端的 src/features/build/ 添加例外,导致该目录被静默忽略。

因此全新 clone 仓库后,frontend/src/main.tsx 和 frontend/src/pages/AgentsHubPage.tsx 引用的两个模块不存在,前端无法构建:

- ./features/build/deployments/DeploymentsPage
- ../features/build/agents/AgentsHubPage(AgentsHubPage 是应用首页,/ 路由会重定向到 /agents)

该问题从初始提交 e5d5cf87("Land Managed Agents service stack with Go aistio control plane.")起就存在。

复现步骤

1. 全新 clone 仓库:
git clone https://github.com/agentscope-ai/agentscope-java.git
cd agentscope-java/agentscope-service/frontend
2. 安装依赖并执行构建:
npm install
npm run build
3. 查看 TypeScript 编译报错。

预期行为

npm run build(即 tsc --noEmit && vite build)应成功完成类型检查并产出 aistio/ui/ 静态资源,src/features/build/ 下的源码应随仓库一起分发。

错误信息

> agentscope-service-frontend@0.1.0 build
> tsc --noEmit && vite build

src/main.tsx:54:29 - error TS2307: Cannot find module './features/build/deployments/DeploymentsPage' or its corresponding type declarations.

54 import DeploymentsPage from './features/build/deployments/DeploymentsPage';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/pages/AgentsHubPage.tsx:17:25 - error TS2307: Cannot find module '../features/build/agents/AgentsHubPage' or its corresponding type declarations.

17 export { default } from '../features/build/agents/AgentsHubPage';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 2 errors in 2 errors.

Errors Files
1 src/main.tsx:54
1 src/pages/AgentsHubPage.tsx:17

环境信息

- AgentScope-Java 版本:2.0.3-SNAPSHOT(commit 2c6977c4;bug 自初始提交 e5d5cf87 起存在)
- Java 版本:17.0.19(前端构建本身不依赖 Java,但部署 aistiod 镜像需要)
- 操作系统:macOS(Darwin 25.4.0)
- Node / npm:v26.7.0 / 11.19.0
- TypeScript:5.9.3(package.json 声明 ^5.7.2);Vite 6.4.3

附加信息

受影响的文件/目录:

- 根目录 .gitignore 第 27 行 build/ 规则缺少前端源码路径的例外。
- 缺失目录:agentscope-service/frontend/src/features/build/,至少包含:
- agents/AgentsHubPage.tsx(被 src/pages/AgentsHubPage.tsx 以 barrel re-export 方式引用,并在 main.tsx 中用于 /agents 路由)
- deployments/DeploymentsPage.tsx(在 main.tsx 中用于 /deployments 路由)
- 该目录下可能还存在其他未被引用到的子模块(api、components、子页面等),需从初始提交者或其他备份处恢复完整源码。

建议修复方式:

1. 在 .gitignore 中为前端源码目录添加例外:
gitignore
build/
!**/src/main/**/build/
!**/src/test/**/build/
!**/frontend/src/features/build/
!**/frontend/src/features/build/**
2. 将 src/features/build/ 下缺失的源文件补回仓库(这些文件目前只存在于初始提交者的工作区,无法从 git 历史恢复)。
3. (可选)考虑将过宽的 build/ 规则收窄为 /build/ 或 **/build/ 配合精确例外,避免未来再次误匹配源码目录。

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.