fix(experts): resolve residual review findings from PR #13 #14
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix/ui-ue-residual-findings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Addresses 4 actionable findings (1 P1 + 3 P2) from the ce-code-review of feat/ui-ue-enhancement (PR #13, merged to main at
8066e0b).Residuals doc:
docs/residual-review-findings/feat-ui-ue-enhancement.mdP1 — expert_step payload alignment (
_phase_executor.py)The thinking/tool_call/tool_result event payloads were missing the fields the frontend
WsServerMessagecontract requires (expert_name/expert_color/content/step). Now allexpert_stepbroadcasts carry the full contract; tool_call/tool_result keepstep_datafor the raw payload.P2 #1 — execute_stream CancellationToken registration (
config_driven.py)execute_stream()bypassedBaseAgent.execute()and never registered aCancellationToken, socancel_task()could not cooperatively cancel a streaming task. Now registers the token and cleans up infinally.P2 #2 — team_synthesis orphan milestone cleanup (
orchestrator.py)If synthesis streaming was interrupted (cancel/exception), no terminal
team_synthesisevent was emitted, leaving the frontend streaming milestone spinning forever. Now an innertry/exceptemits a terminalteam_synthesiswithstatus=cancelled|errorbefore re-raising. Success path also carries thesynthesis_id.P2 #3 — synthesis_id dedup (
orchestrator.py+types.ts+chatStream.ts)Without an identifier the frontend could not precisely match a
team_synthesisterminal event to its streaming milestone. Backend now injects a stablesynthesis_id({plan.id}:synthesis) into bothteam_synthesis_chunkandteam_synthesisevents; frontend uses it for exact milestone matching and treatserror/cancelledstatus as terminal.Test updates
test_thinking_events_forwarded_as_expert_stepto assert the new payload contract (expert_id/name/color/content/step).test_tool_call_events_forwarded_as_expert_stepcovering tool_call/tool_result payload shape (content=tool_name summary + step_data=raw payload).Test plan
ruff check src/agentkit/experts/_phase_executor.py src/agentkit/core/config_driven.py src/agentkit/experts/orchestrator.py→ All checks passedpytest tests/unit/experts/test_phase_executor_streaming.py -x -q→ 14/14 passednpm run typecheck→ cleannpx vitest run→ 126/127 passed (1 unrelated baseline failure intauri-auth.test.ts)Post-deploy monitoring
expert_stepevent payload shape — verify frontend step indicators render with name/color/content correctlyteam_synthesis/team_synthesis_chunkevents — verify no orphan streaming milestones remain after cancelled/error synthesiscancel_task()on streaming team tasks — verify cooperative cancellation now actually stops the streaming task