From 844046a516b202708bfbf54e52d7df0a589f1d8d Mon Sep 17 00:00:00 2001 From: anor Date: Wed, 25 Mar 2026 18:30:07 +1000 Subject: [PATCH] =?UTF-8?q?fix:=20=D1=80=D0=BE=D1=83=D1=82=D0=B5=D1=80=20?= =?UTF-8?q?=E2=80=94=20=D1=81=D0=BC=D0=B5=D1=82=D0=BD=D1=8B=D0=B5=20=D0=BE?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B2=D1=81=D0=B5?= =?UTF-8?q?=D0=B3=D0=B4=D0=B0=20=E2=86=92=20Claude=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены keywords: внеси, обнови, заполни, строк, ячейк, лист, ссрсс, смет Partial match имён файлов (ВСП → находит ЛС-01-02-4-00-01 ВСП.xlsx) "внеси стоимость из ВСП в ССРСС" раньше шло в GLM, теперь в Claude. Co-Authored-By: Claude Opus 4.6 (1M context) --- main.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 84a8f07..906c94e 100644 --- a/main.py +++ b/main.py @@ -42,17 +42,26 @@ elif AI_BACKEND == "auto": "перенеси данн", "измени файл", "отредактируй", "скопируй", "проверь смет", "проверь файл", "открой файл", "покажи файл", "загруж", "прикреп", "файл", ".xlsx", ".docx", ".pdf", ".csv", + "внеси", "обнови", "заполни", "строк", "ячейк", "лист", + "ссрсс", "ссрс", "ведомост", "смет", ] - # Check if message references files in work directory + # Check if message references files in work directory (partial match) from claude_bridge_glm import get_work_dir as _get_wd work_dir = _get_wd(username, tab_id) - file_names = [] + has_files = False + mentions_file = False if work_dir.exists(): - file_names = [f.name.lower() for f in work_dir.iterdir() - if f.is_file() and not f.name.startswith(".")] + for f in work_dir.iterdir(): + if f.is_file() and not f.name.startswith("."): + has_files = True + # Check partial name match (without extension) + stem = f.stem.lower() + parts = [p for p in stem.replace("-", " ").replace("_", " ").split() if len(p) > 2] + if any(p in msg_lower for p in parts): + mentions_file = True + break - mentions_file = any(fn in msg_lower for fn in file_names) if file_names else False has_keyword = any(kw in msg_lower for kw in claude_keywords) use_claude = mentions_file or has_keyword