diff --git a/src/ai_client.py b/src/ai_client.py index 35506709..1c4e5b47 100644 --- a/src/ai_client.py +++ b/src/ai_client.py @@ -1567,6 +1567,7 @@ def _send_gemini(md_content: str, user_message: str, base_dir: str, if _gemini_chat and _gemini_cache_md_hash != current_md_hash: old_history = list(_get_gemini_history_list(_gemini_chat)) if _get_gemini_history_list(_gemini_chat) else [] if _gemini_cache: + #TODO(Ed): Review(Exception) try: _gemini_client.caches.delete(name=_gemini_cache.name) except Exception as e: _append_comms("OUT", "request", {"message": f"[CACHE DELETE WARN] {e}"}) _gemini_chat = None @@ -1586,6 +1587,7 @@ def _send_gemini(md_content: str, user_message: str, base_dir: str, _gemini_cache_created_at = None _gemini_cached_file_paths = [] _append_comms("OUT", "request", {"message": f"[CACHE TTL] Rebuilding cache (expired after {int(elapsed)}s)..."}) + if not _gemini_chat: chat_config = types.GenerateContentConfig( system_instruction = sys_instr, @@ -1595,6 +1597,7 @@ def _send_gemini(md_content: str, user_message: str, base_dir: str, max_output_tokens = _max_tokens, safety_settings = [types.SafetySetting(category=types.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT, threshold=types.HarmBlockThreshold.BLOCK_ONLY_HIGH)] ) + should_cache = False try: if _gemini_client: