优化: 清理无意义注释(走查编号前缀/过时历史标注/死代码注释)

This commit is contained in:
lxy
2026-08-15 18:05:43 +08:00
parent 5a4c821629
commit 5ac815b9ca
137 changed files with 735 additions and 737 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ use super::risk_from_str;
/// **惰性建 `PerConvState`**(不依赖 `active_conversation_id` 单值),使后续 ai_approve →
/// try_continue_agent_loop 的 `conv_read(conv_id)` 命中各自 per_conv(各归各,不串)。
/// `pending_approvals` 本身保持单层 HashMap(设计 §2.1.2,已带 conversation_id 是业务
/// 语义而非路由键)。conversation_id=None 的无主审批(R-9)不建 per_conv(无 conv_id 可挂),
/// 语义而非路由键)。conversation_id=None 的无主审批不建 per_conv(无 conv_id 可挂),
/// 仍进 pending_approvals 单层表,后续审批按 tool_call_id 路由,不影响正确性。
pub async fn restore_pending_approvals(state: &AppState) {
// 清理超 24 小时的残留 pending(旧会话遗留,不再有意义)
@@ -64,7 +64,7 @@ pub async fn restore_pending_approvals(state: &AppState) {
continue;
}
// 多 conv 分配:有 conversation_id 的审批惰性建/复用对应 conv 的 per_conv(设计 §3 batch8)。
// 无 conversation_id 的无主审批(R-9)不建 per_conv——无 conv_id 可挂,仍进 pending_approvals
// 无 conversation_id 的无主审批不建 per_conv——无 conv_id 可挂,仍进 pending_approvals
// 单层表按 tool_call_id 路由,后续 ai_approve 路径不依赖其 per_conv。
if let Some(cid) = rec.conversation_id.as_deref() {
if !cid.is_empty() && convs_restored.insert(cid.to_string()) {
@@ -133,7 +133,7 @@ mod tests_multi_conv_restore {
("tc-1".to_string(), "write_file".to_string(), Some("conv-a".to_string())),
("tc-2".to_string(), "run_command".to_string(), Some("conv-a".to_string())),
("tc-3".to_string(), "delete_project".to_string(), Some("conv-b".to_string())),
("tc-4".to_string(), "create_task".to_string(), None), // 无主(R-9)
("tc-4".to_string(), "create_task".to_string(), None), // 无主
];
// 复现 restore_pending_approvals 的分配逻辑(同名变量,逐字对齐实现)。