Skip to content

feat(home-chat): 四项人与 Agent 对话能力增强(G1 Sub-Agent 可视化 + G2 搜索 + G3 审批接入 + G4 Session 预览) - #487

Merged
ThreeFish-AI merged 4 commits into
feature/1.x.xfrom
ThreeFish-AI/san-francisco-v2
May 10, 2026
Merged

feat(home-chat): 四项人与 Agent 对话能力增强(G1 Sub-Agent 可视化 + G2 搜索 + G3 审批接入 + G4 Session 预览)#487
ThreeFish-AI merged 4 commits into
feature/1.x.xfrom
ThreeFish-AI/san-francisco-v2

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

Summary

基于 origin/feature/1.x.x @ 7e8ec4ce,在「Home / 人与 Agent 对话」模块实现 4 项高/中优先级特性增强,聚焦论文采集场景下的多轮对话体验提升。

G1: Sub-Agent Transfer 可视化(RFC 0002 §4.2)

  • transfer_to_agent 渲染为嵌套委派卡片(父→子 Agent + 状态指示灯 + 可展开响应摘要)
  • 新增 SubAgentTransferDisplaySegment 类型 + SubAgentTransferCard 组件
  • chat-display.ts 检测 transfer_to_agent 并生成独立 segment

G2: 对话内搜索 (Cmd/Ctrl+F)

  • Cmd/Ctrl+F 触发客户端消息搜索,实时高亮匹配节点
  • Enter/Shift+Enter 导航,Escape 关闭
  • 新增 useConversationSearch hook + ConversationSearchBar 组件
  • ChatStream 支持 highlightedNodeIds 高亮 + scrollToNodeId 滚动

G3: Approval Gate 工具接入(RFC 0002 §4.4)

  • ingest_paper 入口集成审批检查,复用 approval.py 已有 polling 机制
  • per_tool 策略下论文入库前弹审批 modal

G4: Session Summary Preview

  • SessionList 会话条目下方显示最后活动时间(相对时间文本)
  • 新增 formatRelativeTime + SessionRecord.timeLabel 字段

Test plan

  • TypeScript 编译通过(tsc --noEmit
  • 635 个前端单元测试全部通过(vitest run
  • ESLint / Ruff lint 通过
  • 浏览器实机验证(需 NE_AUTH_TOKEN_SECRET 配置后手动执行 10 步检查表)
  • E2E 测试补充(G1-A/B, G2-A/B, G3-A/B, G4-A)留后续 PR

🤖 Generated with Claude Code

ThreeFish-AI and others added 4 commits May 10, 2026 08:46
G1 Sub-Agent Transfer 可视化:transfer_to_agent 渲染为嵌套委派卡片
(父→子 Agent 名称 + 状态指示灯 + 可展开响应摘要),取代扁平工具行。
新增 SubAgentTransferDisplaySegment 类型 + SubAgentTransferCard 组件。

G2 对话内搜索:Cmd/Ctrl+F 触发客户端消息搜索,实时高亮匹配节点,
Enter/Shift+Enter 导航,Escape 关闭。搜索范围覆盖文本/工具/推理内容。
新增 useConversationSearch hook + ConversationSearchBar 组件。

G3 Approval Gate 工具接入:ingest_paper 入口集成审批检查(RFC 0002 §4.4),
复用 approval.py 已有 should_request_approval + polling 机制,
per_tool 策略下论文入库前弹审批 modal。

G4 Session Summary Preview:SessionList 会话条目下方显示最后活动时间
("刚刚"/"3 分钟前"/"昨天"/"M/D"),辅助用户辨识历史会话。
新增 formatRelativeTime 工具函数 + SessionRecord.timeLabel 字段。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
G1 Sub-Agent Transfer:
- chat-display: streaming 计算覆盖 subagent-transfer kind
- chat-display: 根级 tool-call transfer 节点正确分流
- SubAgentTransferCard: 移除 expanded 死代码,error 状态红色边框

G2 对话搜索:
- useConversationSearch: 150ms debounce + 最小查询长度 2
- useConversationSearch: isOpen 去掉 matchCount 防关闭后重开
- ChatStream: CSS.escape 防注入

G3 审批闭环:
- 后端 sessions_api: 新增 POST approval_response 端点写入 state
- 前端 BFF: 新增 approval_response route 代理
- home-body: 接入 ApprovalDialog + ApprovalPolicySelector
- home-body: forwardedProps 透传 approval_policy
- paper.py: fail-close + 日志 + ApprovalPolicy 盲解包防护

G4 SessionList: 添加 aria-label 保证 E2E 可访问性

测试修复:
- test_paper_tools: _FakeToolContext 默认 approval_policy=never
- test_paper_kg_pipeline: _Ctx.state 同步设置 approval_policy

🤖 Generated with [Claude Code](https://github.com/claude-code), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
- chat-essentials: §12 补充审批闭环完整链路说明
- rfc 0002: §4.4 更新 G3 前端闭环接入状态
- conversation-foundation: G3/G4 状态标注更新

🤖 Generated with [Claude Code](https://github.com/claude-code), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
fetch 只在网络层异常时 throw,HTTP 非法状态码(500、404)不会抛异常,
导致用户审批决策被静默丢弃。增加 response.ok 检查,失败时抛出异常
让 ApprovalDialog 的 try/catch 向用户展示错误信息。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ThreeFish-AI
ThreeFish-AI merged commit f6db393 into feature/1.x.x May 10, 2026
14 checks passed
@ThreeFish-AI
ThreeFish-AI deleted the ThreeFish-AI/san-francisco-v2 branch May 10, 2026 04:18
ThreeFish-AI added a commit that referenced this pull request Jul 5, 2026
…-2026-4372 处置) (#1057)

* fix(deps): ts-deepmerge 补丁地板至 8.0.0 修复 GHSA-87mf-gv2c-c62c (#481);

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>

* fix(negentropy): pydantic-settings 升 2.14.2 + joserfc>=1.6.7 补丁地板修复 #482/#488;

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>

* fix(cognizes): joserfc/msgpack/python-socketio/python-engineio 补丁地板修复 #483/#486/#487/#490/#491;

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>

* docs(perceives): ISSUE-092 增补 CVE-2026-4372 威胁模型;transformers 钉 4.x + dismiss #492(marker 5.x 不兼容实测);

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
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.

1 participant