修复: run_command 空路径报错 + 隧道日志洪水 + 启动残留清理
- tool_registry: run_command working_dir 空字符串 "" → None,修 Windows os error 123 - lib: tunnel subscriber 从频率压制(suppress_until)改为连接状态感知(is_connected), 断开时静默丢弃事件,重连后恢复透传,记 INFO 状态变迁(治本) - conversation_repo: 新增 cleanup_stale_pending(),超 24h 残留 pending 标记 interrupted - restore: 启动时先清理过期 pending 再恢复审批 - state: 实现 cleanup_orphan_pending_messages(),启动时清理对应已决/超时 tool 的 __PENDING__ 占位消息
This commit is contained in:
@@ -24,6 +24,11 @@ use super::risk_from_str;
|
||||
/// 语义而非路由键)。conversation_id=None 的无主审批(R-9)不建 per_conv(无 conv_id 可挂),
|
||||
/// 仍进 pending_approvals 单层表,后续审批按 tool_call_id 路由,不影响正确性。
|
||||
pub async fn restore_pending_approvals(state: &AppState) {
|
||||
// 清理超 24 小时的残留 pending(旧会话遗留,不再有意义)
|
||||
if let Err(e) = state.ai_tool_executions.cleanup_stale_pending(86400).await {
|
||||
tracing::warn!("清理过期 pending 审批失败(非阻断): {}", e);
|
||||
}
|
||||
|
||||
let pending = match state.ai_tool_executions.list_pending().await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
|
||||
@@ -2680,7 +2680,8 @@ fn register_file_tools(
|
||||
|
||||
let request = ShellRequest {
|
||||
command: command.clone(),
|
||||
working_dir: Some(working_dir.clone()),
|
||||
// 空字符串 → None(空路径是非法 current_dir,Windows 报 os error 123)
|
||||
working_dir: if working_dir.is_empty() { None } else { Some(working_dir.clone()) },
|
||||
env: HashMap::new(),
|
||||
timeout_secs: Some(timeout_secs),
|
||||
shell_type: Default::default(),
|
||||
|
||||
Reference in New Issue
Block a user