Agent: explicitly save cache on shutdown and in each tool call

This commit is contained in:
Michael Panchenko committed 2025-06-04 21:03:07 +02:00
1 parent 5411b1063a
commit 88a10e7234
1 file changed
+6
+6
View File
@@ -835,6 +835,7 @@ class SerenaAgent:
if self.is_language_server_running():
log.info("Stopping the language server ...")
assert self.language_server is not None
self.language_server.save_cache()
self.language_server.stop()
if self._gui_log_handler:
log.info("Stopping the GUI log window ...")
@@ -1008,6 +1009,11 @@ class Tool(Component):
if log_call:
log.info(f"Result: {result}")
try:
self.language_server.save_cache()
except Exception as e:
log.error(f"Error saving language server cache: {e}")
return result