fix(ai): improve assistant execution and MCP settings

This commit is contained in:
t8y2 committed 2026-07-10 14:31:08 +08:00
1 parent 1c18a80092
commit 5a666b1f48
20 files changed
+213 -47

No files matched your search

+6
View File
@@ -86,6 +86,7 @@ pub async fn ai_agent_stream(
database: String,
db_type: String,
mode: Option<String>,
allow_write_sql: Option<bool>,
) -> Result<String, String> {
let request = resolve_codex_cli_request(request);
let cancelled = dbx_core::ai::register_stream(&session_id).await;
@@ -104,6 +105,11 @@ pub async fn ai_agent_stream(
database,
db_type: parsed_db_type,
cli_mcp_server_command,
// Explicit confirmation grants write access only to this agent run.
sql_permissions: dbx_core::agent_tools::AgentSqlPermissions {
allow_writes: allow_write_sql.unwrap_or(false),
allow_dangerous: allow_write_sql.unwrap_or(false),
},
};
let is_agent_mode = mode.as_deref() == Some("agent");