From f5a6f4da7092191efdd305b65865e89636efd514 Mon Sep 17 00:00:00 2001 From: Aaron Weisberg Date: Fri, 19 Dec 2025 14:10:33 -0800 Subject: [PATCH] fix: improve context clearing in new sessions and file mentions - Clear attachments when starting a new session with /new command - Toggle file removal when selecting already-mentioned files with @ trigger - Fixes issue where context persisted across new sessions - Fixes issue where @ file selection only added files, never removed them --- lua/opencode/core.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/opencode/core.lua b/lua/opencode/core.lua index f68af3e8..76783859 100644 --- a/lua/opencode/core.lua +++ b/lua/opencode/core.lua @@ -93,6 +93,7 @@ M.open = Promise.async(function(opts) if opts.new_session then state.active_session = nil state.last_sent_context = nil + context.unload_attachments() state.current_model = nil state.current_mode = nil