From dd3894df68c145c012bec3108af2c226f48cde7d Mon Sep 17 00:00:00 2001 From: Illuminated2020 <2357303264@qq.com> Date: Sun, 10 May 2026 23:31:36 +0800 Subject: [PATCH] =?UTF-8?q?style(agent-runtime):=20=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E8=BF=90=E8=A1=8C=E6=97=B6=E9=A3=8E=E9=99=A9=E8=BE=85?= =?UTF-8?q?=E5=8A=A9=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/src/commands/agent_runtime.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/commands/agent_runtime.rs b/src-tauri/src/commands/agent_runtime.rs index 0e1a284da4..6ca16883ce 100644 --- a/src-tauri/src/commands/agent_runtime.rs +++ b/src-tauri/src/commands/agent_runtime.rs @@ -398,7 +398,10 @@ async fn load_handoff_connection(app_state: Option<&AppState>, connection_id: &s } } -fn matching_snapshot_connection_name<'a>(item: &HandoffItem, snapshot: &'a AgentRuntimeSnapshot) -> Option<&'a str> { +fn matching_snapshot_connection_name<'a>( + item: &HandoffItem, + snapshot: &'a AgentRuntimeSnapshot, +) -> Option<&'a str> { let handoff_connection_id = item.connection_id.trim(); let active_connection_id = snapshot.active_connection_id.as_deref().map(str::trim)?; if handoff_connection_id.is_empty() || handoff_connection_id != active_connection_id { @@ -408,8 +411,10 @@ fn matching_snapshot_connection_name<'a>(item: &HandoffItem, snapshot: &'a Agent } fn conservative_production_risk(sql: &str) -> dbx_core::sql_safety::RiskMetadata { - let mut risk = - risk_for(sql, RiskContext { connection_name: "unknown", color: None, environment_label: Some("Production") }); + let mut risk = risk_for( + sql, + RiskContext { connection_name: "unknown", color: None, environment_label: Some("Production") }, + ); risk.is_production = true; risk.risk_level = match classify_sql(sql) { OperationClass::Ddl => RiskLevel::Critical, @@ -553,7 +558,11 @@ mod tests { AgentRuntimeState { app_state: Some(Arc::new(AppState::new(storage))), ..runtime_state() } } - fn connection_config(id: &str, name: &str, color: Option<&str>) -> dbx_core::models::connection::ConnectionConfig { + fn connection_config( + id: &str, + name: &str, + color: Option<&str>, + ) -> dbx_core::models::connection::ConnectionConfig { dbx_core::models::connection::ConnectionConfig { id: id.to_string(), name: name.to_string(),