Version: 0.9.75.dev.260505
后端: 1.收口阶段 6 agent 结构迁移,将 newAgent 内核与 agentsvc 编排层迁入 services/agent - 切换 Agent 启动装配与 HTTP handler 直连 agent sv,移除旧 service agent bridge - 补齐 Agent 对 memory、task、task-class、schedule 的 RPC 适配与契约字段 - 扩展 schedule、task、task-class RPC/contract 支撑 Agent 查询、写入与 provider 切流 - 更新迁移文档、README 与相关注释,明确 agent 当前切流点和剩余 memory 迁移面
This commit is contained in:
@@ -494,11 +494,17 @@ flowchart LR
|
||||
|
||||
这一步要做的事:
|
||||
|
||||
1. 把 `newAgent` 里的路由、prompt、graph、tool registry、会话状态和 SSE 输出包装收进 `agent` 服务。
|
||||
1. 把已搬入 `backend/services/agent` 的原 `newAgent` 路由、prompt、graph、tool registry、会话状态和 SSE 输出继续包装收进 `agent` 服务。
|
||||
2. 把 `memory` 的 repo、worker、orchestrator 和审计写入收进 `memory` 服务。
|
||||
3. gateway 只保留鉴权、路由转发和流式透传,不再直接承担 agent 会话编排。
|
||||
4. 过渡期允许 agent 先通过同进程适配器访问现有能力,但切流点必须清楚。
|
||||
|
||||
当前进展(2026-05-05):
|
||||
|
||||
1. `backend/newAgent/*` 已按机械搬迁方式迁入 `backend/services/agent/*`,Go import 路径和 `agent*` 包名前缀已切到新位置。
|
||||
2. `backend/service/agentsvc/*` 已继续机械迁入 `backend/services/agent/sv/*`,启动装配和 Agent HTTP handler 直接依赖 `agent/sv.AgentService`。
|
||||
3. 历史 timeline payload key(如 `newagent_history_kind`)暂不改名,避免破坏旧会话兼容。
|
||||
|
||||
建议提交点:
|
||||
|
||||
1. agent 服务可以独立启动时先 commit。
|
||||
@@ -740,7 +746,7 @@ SmartFlow-Agent/
|
||||
> 1. `backend/services/userauth/*` 已经是阶段 2 终态样板;旧 `backend/api/user.go`、`backend/service/user.go`、`backend/dao/user.go`、`backend/model/user.go`、`backend/model/auth.go`、`backend/auth/jwt_handler.go`、`backend/middleware/token_handler.go`、`backend/middleware/token_quota_guard.go`、`backend/routers/routers.go` 不再作为活跃实现。
|
||||
> 2. `backend/gateway/api/userauth/*` 是 user HTTP 入口,`backend/gateway/client/userauth/*` 是 userauth zrpc client,二者都属于 gateway 边缘层。
|
||||
> 3. `backend/service/*.go` 这批现有业务逻辑,后面要分别迁到各自服务根目录下的 `sv/`。
|
||||
> 4. `backend/service/agentsvc/*` 和 `backend/newAgent/*`,后面要收束到 `backend/services/agent/sv/` + `internal/{prompt,graph,stream,tool,session,router}`。
|
||||
> 4. `backend/services/agent/*` 已承接原 `backend/newAgent/*` 内核,`backend/services/agent/sv/*` 已承接原 `backend/service/agentsvc/*` 编排层;后面再按风险拆到 `internal/{prompt,graph,stream,tool,session,router}`。
|
||||
> 5. `backend/services/notification/*` 已经是阶段 3 终态样板;`backend/cmd/notification` 是独立进程入口,`backend/gateway/client/notification` 是 gateway 侧 zrpc client,`backend/shared/contracts/notification` 只放跨层契约;旧 `backend/notification/*`、旧 DAO/model 和旧 `service/events/notification_feishu.go` 不再作为活跃实现。
|
||||
> 6. `backend/services/active_scheduler/*` 已经是阶段 4 当前样板;`backend/cmd/active-scheduler` 是独立进程入口,`backend/gateway/client/activescheduler` 是 gateway 侧 zrpc client,`backend/services/active_scheduler/core` 承载迁移期领域核心;旧 `backend/active_scheduler/*` 不再作为活跃实现。
|
||||
> 7. `backend/memory/*`,后面要收束到 `backend/services/memory/`;当前 `memory/service/*` 只是迁移过渡态,终态还是按 `sv/` 或 `internal/` 拆开。
|
||||
@@ -805,7 +811,7 @@ SmartFlow-Agent/
|
||||
| `task` | 任务新增、完成/撤销、任务池查询、紧急性平移 | `start.go` / `handler.go` / `sv/` / `dao/` / `model/` / `internal/{policy,event,urgency}/` | 不要把 task 的状态机塞进 agent 或 schedule |
|
||||
| `llm-service` | 统一模型调用、provider 路由、流式输出、重试、限流、审计 | `start.go` / `handler.go` / `sv/` / `model/` / `internal/{provider,router,stream,quota,audit}/` | 不要把业务 prompt、状态机、工具编排塞进模型出口 |
|
||||
| `rag-service` | 向量化、召回、重排、向量库读写、语料适配、检索 API | `start.go` / `handler.go` / `sv/` / `model/` / `internal/{chunk,embed,rerank,retrieve,store,corpus,observe}/` | 不要让业务服务直连向量库并绕开统一检索层 |
|
||||
| `agent` | 多轮对话、SSE、工具调用、计划/执行编排、主动调度会话复跑;模型推理走 `llm-service`,记忆检索走 `memory` / `rag-service` | 当前过渡形态是 `backend/service/agentsvc` + `backend/newAgent/*`;终态应收束为 `start.go` / `handler.go` / `sv/` / `dao/` / `model/` / `internal/{prompt,graph,stream,tool,session,router}/` | 不要把 memory、notification、schedule 的业务实现塞进 agent,只通过契约调用 |
|
||||
| `agent` | 多轮对话、SSE、工具调用、计划/执行编排、主动调度会话复跑;模型推理走 `llm-service`,记忆检索走 `memory` / `rag-service` | 当前过渡形态是 `backend/services/agent/{sv,conv,graph,model,node,prompt,router,shared,stream,tools}`;原 `newAgent` 内核和原 `agentsvc` 编排层都已收入 `services/agent`,终态再收束为 `start.go` / `handler.go` / `sv/` / `dao/` / `model/` / `internal/{prompt,graph,stream,tool,session,router}/` | 不要把 memory、notification、schedule 的业务实现塞进 agent,只通过契约调用 |
|
||||
| `memory` | 记忆抽取、检索、管理、worker 执行、观测埋点;抽取走 `llm-service`,检索走 `rag-service` | `start.go` / `handler.go` / `sv/` / `dao/` / `model/` / `internal/{repo,orchestrator,worker,observe,cleanup,vectorsync}/`;当前 `module.go` 只是过渡总门面 | 不要把 memory 变成 gateway 的辅助函数 |
|
||||
|
||||
`shared` 和 `shared/infra` 不在这张表里,因为它们不是业务服务,只承载跨服务契约和少量公共底座,不按某一个域服务的用例来改。
|
||||
|
||||
Reference in New Issue
Block a user