fischer-agentkit/tests/unit/experts
chiguyong 47a437c5e3
Test / backend-test (pull_request) Has been cancelled Details
Test / frontend-unit (pull_request) Has been cancelled Details
Test / api-e2e (pull_request) Has been cancelled Details
Test / frontend-e2e (pull_request) Has been cancelled Details
fix(experts): resolve residual review findings from PR #13
Addresses 4 actionable findings (1 P1 + 3 P2) from ce-code-review of
feat/ui-ue-enhancement (PR #13), now merged to main (8066e0b).

P1 — expert_step payload alignment (_phase_executor.py)
  The thinking/tool_call/tool_result event payloads were missing the
  fields the frontend WsServerMessage contract requires
  (expert_name/expert_color/content/step). Frontend code consuming these
  events silently degraded. Now all expert_step broadcasts carry the
  full contract; tool_call/tool_result keep step_data for the raw payload.

P2 #1 — execute_stream CancellationToken registration (config_driven.py)
  execute_stream() bypassed BaseAgent.execute() and never registered a
  CancellationToken, so cancel_task() could not cooperatively cancel a
  streaming task. Now registers the token and cleans it up in finally.

P2 #2 — team_synthesis orphan milestone cleanup (orchestrator.py)
  If synthesis streaming was interrupted (cancel/exception), no terminal
  team_synthesis event was emitted, leaving the frontend streaming
  milestone spinning forever. Now an inner try/except emits a terminal
  team_synthesis with status=cancelled|error before re-raising, so the
  frontend can finalize the milestone. The success path also carries
  the synthesis_id.

P2 #3 — synthesis_id dedup (orchestrator.py + types.ts + chatStream.ts)
  Without an identifier, the frontend could not precisely match a
  team_synthesis terminal event to its streaming milestone (especially
  across retries/concurrent teams). The backend now injects a stable
  synthesis_id (`{plan.id}:synthesis`) into both team_synthesis_chunk
  and team_synthesis events; the frontend uses it for exact milestone
  matching and treats error/cancelled status as terminal.

Test updates
  - Updated test_thinking_events_forwarded_as_expert_step to assert the
    new payload contract (expert_id/name/color/content/step).
  - Added test_tool_call_events_forwarded_as_expert_step covering
    tool_call/tool_result payload shape (content=tool_name摘要 +
    step_data=原始 payload).

Verification
  - ruff check: clean
  - pytest tests/unit/experts/test_phase_executor_streaming.py: 14/14
  - npm run typecheck: clean
  - vitest: 126/127 (1 unrelated baseline failure in tauri-auth.test.ts)

Residuals doc: docs/residual-review-findings/feat-ui-ue-enhancement.md
2026-07-01 13:26:19 +08:00
..
__init__.py feat: Expert Team Mode — plan-execute collaboration with conversation UI 2026-06-14 22:20:14 +08:00
test_board_backtest.py feat: 私董会讨论模式 + 回测集成 + WS持久化修复 2026-06-17 23:52:53 +08:00
test_board_orchestrator.py feat: 私董会讨论模式 + 回测集成 + WS持久化修复 2026-06-17 23:52:53 +08:00
test_board_router.py feat: 企业级客户端-服务端架构 + 代码审查修复 2026-06-20 06:48:18 +08:00
test_board_team.py feat: 私董会讨论模式 + 回测集成 + WS持久化修复 2026-06-17 23:52:53 +08:00
test_config.py feat: Expert Team Mode — plan-execute collaboration with conversation UI 2026-06-14 22:20:14 +08:00
test_divergence_detection.py feat(experts): U3 分歧检测 + 方案评审辩论自动触发 2026-06-24 11:09:53 +08:00
test_expert.py feat: Expert Team Mode — plan-execute collaboration with conversation UI 2026-06-14 22:20:14 +08:00
test_orchestrator_debate.py feat(experts): U4 用户干预通道 + 手动辩论触发 2026-06-24 12:17:09 +08:00
test_phase_executor_streaming.py fix(experts): resolve residual review findings from PR #13 2026-07-01 13:26:19 +08:00
test_plan.py feat(experts): U1 协作契约数据模型 + Lead 生成契约 2026-06-24 13:44:50 +08:00
test_pm_collaboration.py fix(experts): PM 协同代码审查全量修复 2026-06-24 18:56:27 +08:00
test_registry.py feat: Expert Team Mode — plan-execute collaboration with conversation UI 2026-06-14 22:20:14 +08:00
test_router.py feat(experts): U7 新增 5 个编程专家模板 + dev_team 团队模板 + ExpertTeamRouter 模板展开 2026-06-18 01:50:43 +08:00
test_team.py feat(experts):重写 TeamOrchestrator 为流水线模式 + TeamStatus.PLANNING 2026-06-18 01:39:22 +08:00
test_team_intervention.py feat(experts): U4 用户干预通道 + 手动辩论触发 2026-06-24 12:17:09 +08:00
test_team_orchestrator.py refactor(core,experts): classify except Exception + structured ReviewResult (U3) 2026-06-30 18:03:58 +08:00