Skip to content

feat(ai): add progress feedback to eliminate waiting anxiety#90

Merged
hrygo merged 7 commits into
mainfrom
feat/89-ai-chat-progress-main
Feb 7, 2026
Merged

feat(ai): add progress feedback to eliminate waiting anxiety#90
hrygo merged 7 commits into
mainfrom
feat/89-ai-chat-progress-main

Conversation

@hrygo

@hrygo hrygo commented Feb 7, 2026

Copy link
Copy Markdown
Owner

概述

实现 AI 聊天进度反馈功能,消除用户发送消息后 5-10 秒的「死寂期」,通过即时反馈改善用户体验。

核心原则

基于 200ms 心理阈值:用户发送消息后,200ms 内必须有视觉反馈,否则会产生焦虑感。

变更内容

后端事件

  • received - 消息已接收确认(所有模式)
  • routing_start - 开始意图路由
  • routing_end - 路由完成(含 Agent 信息和耗时)

前端组件

  • StatusBadge - 状态徽章(sending/received/routing/thinking/tool_running)
  • ProgressBar - 多阶段进度条(pending → running → completed)
  • useProgressStatus - 进度状态管理 Hook

关联 Issue

Resolves #89

测试计划

  • 本地测试通过
  • 单元测试新增/更新
  • make check-all 通过
  • 修复预存在测试 bug (EventMeta JSON field names)

截图/演示

待前端集成后补充

检查清单

  • 代码遵循项目规范
  • 自我审查代码
  • 注释说明了复杂逻辑
  • 文档已更新(后续)
  • 无合并冲突

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

hotplex-ai and others added 7 commits February 6, 2026 21:58
Add React and related dependencies to optimizeDeps.include to prevent
runtime issues where React hooks may be unavailable due to module
loading order problems.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add ai.chat.user_message log to help diagnose issue where
messages are silently swallowed after previous block is done.

Related to #4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root cause: When AmazingParrot's plan sets needs_direct_answer=true
(with no memo_search/schedule_query/etc), the retrievalResults map
is empty. This caused buildSynthesisPrompt to generate a synthesis
prompt with an empty context placeholder, which could cause the LLM
to hang or produce unexpected behavior.

Changes:
- Add fallback casual chat prompt when no retrieval results exist
- Add extensive debug logging to track synthesis flow
- Add chunk counting and channel close logging for better visibility

This fixes the bug where messages are "swallowed" after a block
completes with status=done.

Related: Task #4

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add immediate feedback events to eliminate 5-10 second "dead silence"
after user sends message. Implements 200ms psychological threshold
principle for user experience.

Backend changes:
- Add "received" event sent immediately after message receipt
- Add "routing_start" event before intent classification
- Add "routing_end" event with agent info and duration
- Apply events consistently across Normal/Geek/Evolution modes

Refs #89

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test was checking for PascalCase field names (DurationMs, ToolName)
but the struct uses snake_case JSON tags (duration_ms, tool_name).

This is a pre-existing bug in PR #65 that caused CI to fail.

Refs #89

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fix gofmt alignment issues detected by CI golangci-lint.

Refs #90

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@hrygo hrygo merged commit e9b92dc into main Feb 7, 2026
10 checks passed
@hrygo hrygo deleted the feat/89-ai-chat-progress-main branch February 7, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(ai): AI Chat 进度反馈优化 - 消除等待焦虑

2 participants