From 81e013d7a8a035af3f3b8a73bc5ccce6b9f82002 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Thu, 25 Jun 2026 12:33:13 -0400 Subject: [PATCH] refactor(ai_client): migrate _send_qwen to provider_state.get_history('qwen') --- src/ai_client.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ai_client.py b/src/ai_client.py index f1ce2b29..a9dd1ad8 100644 --- a/src/ai_client.py +++ b/src/ai_client.py @@ -2810,18 +2810,19 @@ def _send_qwen(md_content: str, user_message: str, base_dir: str, from src.qwen_adapter import classify_dashscope_error try: _ensure_qwen_client() - with _qwen_history_lock: + history = provider_state.get_history("qwen") + with history.lock: user_content = user_message if file_items: for fi in file_items: if fi.get("is_image") and fi.get("base64_data"): user_content = f"[IMAGE: {fi.get('path', 'attachment')}]\n{user_content}" - if discussion_history and not _qwen_history: - _qwen_history.append({"role": "user", "content": f"[DISCUSSION HISTORY]\n\n{discussion_history}\n\n---\n\n{user_message}"}) + if discussion_history and not history: + history.append({"role": "user", "content": f"[DISCUSSION HISTORY]\n\n{discussion_history}\n\n---\n\n{user_message}"}) else: - _qwen_history.append({"role": "user", "content": user_content}) + history.append({"role": "user", "content": user_content}) messages = [{"role": "system", "content": f"{_get_combined_system_prompt()}\n\n\n{md_content}\n"}] - messages.extend(_qwen_history) + messages.extend(history) resp = _dashscope_call( model=_model, messages=messages,