fix(audit): Batch 0-1 文档校准 + let _ = 静默错误修复
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Batch 0:
- TRUTH.md 中间件层 14→15 (补 EvolutionMiddleware@78)
- wiki/middleware.md 同步 15 层 + 优先级分类更新
- Store 数字确认 25 个

Batch 1:
- approvals.rs: 3 处 map_err+let _ = 简化为 if let Err
- director.rs: oneshot send 失败添加 debug 日志
- task.rs: 4 处子任务状态更新添加 debug 日志
- chat.rs: 流消息发送和事件 emit 添加 warn/debug 日志
- heartbeat.rs: 告警广播添加 debug 日志 + break 优化

全量测试通过: 719 passed, 0 failed
This commit is contained in:
iven
2026-04-19 08:30:33 +08:00
parent e94235c4f9
commit 924ad5a6ec
7 changed files with 75 additions and 47 deletions

View File

@@ -573,10 +573,13 @@ Respond with ONLY the number (1-{}) of the agent who should speak next. No expla
// Find and dispatch to the correct oneshot sender
if msg.message_type == A2aMessageType::Response {
if let Some(ref reply_to) = msg.reply_to {
let reply_to_clone = reply_to.clone();
let mut pending_guard = pending.lock().await;
if let Some(sender) = pending_guard.remove(reply_to) {
// Send the response; if receiver already dropped, that's fine
let _ = sender.send(msg);
// Send the response; if receiver already dropped, request was cancelled
if sender.send(msg).is_err() {
tracing::debug!("[Director] Response dropped: receiver cancelled for reply_to={}", reply_to_clone);
}
}
}
}

View File

@@ -85,14 +85,14 @@ impl Kernel {
started_at: None,
completed_at: None,
};
let _ = memory.save_hand_run(&run).await.map_err(|e| {
if let Err(e) = memory.save_hand_run(&run).await {
tracing::error!("[Approval] Failed to save hand run: {}", e);
});
}
run.status = HandRunStatus::Running;
run.started_at = Some(chrono::Utc::now().to_rfc3339());
let _ = memory.update_hand_run(&run).await.map_err(|e| {
if let Err(e) = memory.update_hand_run(&run).await {
tracing::error!("[Approval] Failed to update hand run (running): {}", e);
});
}
// Register cancellation flag
let cancel_flag = Arc::new(std::sync::atomic::AtomicBool::new(false));
@@ -121,9 +121,9 @@ impl Kernel {
}
run.duration_ms = Some(duration.as_millis() as u64);
run.completed_at = Some(completed_at);
let _ = memory.update_hand_run(&run).await.map_err(|e| {
if let Err(e) = memory.update_hand_run(&run).await {
tracing::error!("[Approval] Failed to update hand run (completed): {}", e);
});
}
// Update approval status based on execution result
let mut approvals = approvals.lock().await;