fix(agent): 🐛 Emit requested events for task tools - #153
Conversation
AI Code Review SummaryPR: #153 (fix(agent): 🐛 Emit requested events for task tools) Overall AssessmentDetected 1 actionable findings, prioritize CRITICAL/HIGH before merge. Major Findings by Severity
Actionable Suggestions
Potential Risks
Test Suggestions
File-Level Coverage Notes
Inline Downgraded Items (processed but not inline)
Coverage Status
Uncovered list:
No-patch covered list:
Runtime/Budget
|
| return agent_error_result(format!("failed to persist tool call: {error}")); | ||
| } | ||
|
|
||
| let _ = self.event_tx.send(ThreadStreamEvent::ToolRequested { |
There was a problem hiding this comment.
[MEDIUM] Silently ignored send error on ToolRequested event
The ToolRequested event send error is silently dropped with let _ = ..., making it impossible to know if frontend subscribers actually received the new state.
Suggestion: Either log a warning when the send fails, or propagate the error as a non-fatal early-warning event so that the caller can detect the broken channel and clean up gracefully.
Risk: If the event channel is closed, the new ToolRequested state becomes invisible to consumers while the method continues execution, leading to subtle UI inconsistencies that are hard to reproduce.
Confidence: 0.85
Summary
tool_requestedevents for task tools before they enter the running state.Test Plan
cargo fmt --manifest-path src-tauri/Cargo.toml -- --checknpm run test:unit -- src/services/thread-stream/thread-stream.test.tsnpm run typecheckcargo test --manifest-path src-tauri/Cargo.toml --test task_tracking🤖 Generated with TiyCode