Skip to content

【Bug】对话消息数量统计异常:Agent执行任务时对话数持续增长,实际无新对话 #602

@Clawiee

Description

@Clawiee

问题描述

红框内对话消息数量统计异常:

  • 实际没有新的用户对话产生
  • 但在 Agent 执行一次任务过程中,对话数量持续上升

复现路径(推测)

  1. 启动一个 Agent 任务(如日报生成、调研分析)
  2. 观察右上角/侧边栏对话计数器
  3. 计数器在任务执行中不断递增,而非仅在用户发送新消息时更新

可能原因(供研发参考)

  • 消息中间状态(如 'thinking', 'streaming', 'retry')被错误计入对话数
  • 未区分用户消息与系统/Agent 自动产生的内部消息(如 tool_call / tool_response)
  • 分页游标或会话 ID 绑定逻辑错误,导致同一会话被重复计数
  • 前端未做防抖,高频更新触发多次渲染计数

期望行为

对话数量仅在以下情况增加:

  • 用户发送一条新消息
  • Agent 返回一条最终、可展示给用户的响应消息(非中间流式 chunk 或内部状态)

附件

见原始截图(image_56f6a35g.jpg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions