diff --git a/src/mcp/mod.rs b/src/mcp/mod.rs index 3b7202a..8da71b1 100644 --- a/src/mcp/mod.rs +++ b/src/mcp/mod.rs @@ -111,8 +111,6 @@ struct ChatRecord { struct McpSession { root_uri: Option, last_uri: Option, - #[serde(default)] - skip_next_save: bool, } fn session_path() -> Result { @@ -211,15 +209,8 @@ fn save_chat_record( /// Handle chat_save tool fn handle_chat_save(params: ChatSaveParams) -> Result { - // Check if we should skip this save (after chat_new) + // Load session let mut session = load_mcp_session(); - if session.skip_next_save { - session.skip_next_save = false; - session.root_uri = None; - session.last_uri = None; - save_mcp_session(&session)?; - return Ok("Skipped save (new thread started). Next message will be saved.".to_string()); - } // Get output directory let output_dir = env::var("CHAT_OUTPUT").unwrap_or_else(|_| { @@ -325,7 +316,6 @@ fn handle_chat_new() -> Result { let session = McpSession { root_uri: None, last_uri: None, - skip_next_save: true, // Skip the next save (the "new thread" message) }; save_mcp_session(&session)?; Ok("New chat thread started. The next conversation will begin a new thread.".to_string())