Version: 0.9.61.dev.260501
后端:
1. 主动调度 graph + session bridge 收口——把 dry-run / select / preview / confirm / rerun 串成受限 graph,新增 active_schedule_sessions 缓存与聊天拦截,ready_preview 后释放回自由聊天
2. 会话与通知链路对齐——notification 统一绑定 conversation_id,action_url 指向 /assistant/{conversation_id},会话不存在改回 404 语义,避免 wrong param type 误导排障
3. estimated_sections 写入与主动调度消费链路补齐——任务创建、quick task 与随口记入口都透传估计节数,主动调度只消费落库值
前端:
4. AssistantPanel 最小适配主动调度预览与失败态——复用主动调度卡片/微调弹窗,补历史加载失败可见提示与跨账号会话拦截
文档:
5. 更新主动调度缺口分阶段实施计划和实现方案,标记阶段 0-2 收口并同步接力状态
This commit is contained in:
@@ -156,7 +156,7 @@ func (api *AgentHandler) ChatAgent(c *gin.Context) {
|
||||
// 设计说明:
|
||||
// 1) 该接口用于配合 SSE 聊天链路:标题异步生成后,前端可通过 conversation_id 拉取;
|
||||
// 2) 不依赖 SSE header 动态更新,避免“header 必须首包前写入”的协议限制;
|
||||
// 3) 会话不存在时返回 400,避免前端把无效会话当成系统错误。
|
||||
// 3) 会话不存在或不属于当前用户时返回 404,避免前端把无效会话误判成参数类型错误。
|
||||
func (api *AgentHandler) GetConversationMeta(c *gin.Context) {
|
||||
// 1. 读取 query 参数并做基础校验。
|
||||
conversationID := strings.TrimSpace(c.Query("conversation_id"))
|
||||
@@ -175,9 +175,9 @@ func (api *AgentHandler) GetConversationMeta(c *gin.Context) {
|
||||
// 4. 调 service 查询会话元信息。
|
||||
meta, err := api.svc.GetConversationMeta(ctx, userID, conversationID)
|
||||
if err != nil {
|
||||
// 会话不存在按参数错误处理,返回 400 给前端更直观。
|
||||
// 会话不存在或越权访问时返回 404,让前端能和“参数格式错误”区分开。
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
c.JSON(http.StatusBadRequest, respond.WrongParamType)
|
||||
c.JSON(http.StatusNotFound, respond.ConversationNotFound)
|
||||
return
|
||||
}
|
||||
respond.DealWithError(c, err)
|
||||
@@ -255,7 +255,7 @@ func (api *AgentHandler) GetConversationList(c *gin.Context) {
|
||||
// 说明:
|
||||
// 1. 该接口是新前端刷新重建的单一来源;
|
||||
// 2. 返回结果已按 seq 升序,前端按数组顺序渲染即可;
|
||||
// 3. 会话不存在时统一返回 400,避免误判成系统异常。
|
||||
// 3. 会话不存在或不属于当前用户时统一返回 404,避免误判成参数格式问题。
|
||||
func (api *AgentHandler) GetConversationTimeline(c *gin.Context) {
|
||||
conversationID := strings.TrimSpace(c.Query("conversation_id"))
|
||||
if conversationID == "" {
|
||||
@@ -271,7 +271,7 @@ func (api *AgentHandler) GetConversationTimeline(c *gin.Context) {
|
||||
timeline, err := api.svc.GetConversationTimeline(ctx, userID, conversationID)
|
||||
if err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
c.JSON(http.StatusBadRequest, respond.WrongParamType)
|
||||
c.JSON(http.StatusNotFound, respond.ConversationNotFound)
|
||||
return
|
||||
}
|
||||
respond.DealWithError(c, err)
|
||||
|
||||
Reference in New Issue
Block a user