From 4181253b178b27913fe0d68f3eb93547f5398a09 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Thu, 14 May 2026 10:42:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E8=A7=A3=E6=9E=90=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=BF=9D=E5=AD=98=E4=BC=9A=E8=AF=9D=E5=88=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=B8=BB=E7=9B=AE=E5=BD=95=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=20.picobot/sessions/=20=E7=9B=AE=E5=BD=95=EF=BC=9B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20InboundProcessor=20=E7=BB=93=E6=9E=84=E4=BD=93?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/command/handlers/save_session.rs | 10 ++++++++-- src/gateway/processor.rs | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/command/handlers/save_session.rs b/src/command/handlers/save_session.rs index d4fd394..fcd4b19 100644 --- a/src/command/handlers/save_session.rs +++ b/src/command/handlers/save_session.rs @@ -327,7 +327,8 @@ pub fn format_timestamp(ts: i64) -> String { /// 解析文件路径 /// -/// 如果未提供路径,自动生成基于会话标题和时间戳的文件名 +/// 如果未提供路径,自动生成基于会话标题和时间戳的文件名, +/// 保存到用户主目录下的 .picobot/sessions/ 目录 pub fn resolve_filepath(filepath: Option, record: &SessionRecord) -> PathBuf { match filepath { Some(path) => PathBuf::from(path), @@ -357,7 +358,12 @@ pub fn resolve_filepath(filepath: Option, record: &SessionRecord) -> Pat let timestamp = Local::now().format("%Y%m%d_%H%M%S"); let filename = format!("{}_{}.md", base_name, timestamp); - PathBuf::from(filename) + // 保存到用户主目录下的 .picobot/sessions/ 目录 + dirs::home_dir() + .unwrap_or_else(|| PathBuf::from(".")) + .join(".picobot") + .join("sessions") + .join(filename) } } } diff --git a/src/gateway/processor.rs b/src/gateway/processor.rs index 30cd637..84cc7ba 100644 --- a/src/gateway/processor.rs +++ b/src/gateway/processor.rs @@ -15,7 +15,7 @@ pub struct InboundProcessor { bus: Arc, session_manager: SessionManager, semaphore: Arc, - provider_config: LLMProviderConfig, + _provider_config: LLMProviderConfig, command_router: Arc, } @@ -40,7 +40,7 @@ impl InboundProcessor { bus, session_manager, semaphore, - provider_config, + _provider_config: provider_config, command_router: Arc::new(command_router), } }