UserPromptSubmit recall regex is English-only: Chinese prompts never trigger auto-recall
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- backend
Hướng nghiên cứu
Đọc hooks/zcode-mem-hook.mjs, đặc biệt là định nghĩa RECALL_PROMPT_RE ở dòng 8–9, và kiểm tra cách hook UserPromptSubmit sử dụng nó. Issue cung cấp một thay đổi regex và các prompt mẫu để xác minh: prompt tiếng Trung về lịch sử phải kích hoạt việc truy hồi, còn prompt không liên quan thì không. Chạy các bài kiểm thử hook liên quan nếu có; issue không nêu tên tệp kiểm thử nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The UserPromptSubmit recall hook never fires for Chinese-language prompts, because RECALL_PROMPT_RE in hooks/zcode-mem-hook.mjs only matches English keywords. For users who work primarily in Chinese, the auto-recall feature is effectively dead.
Details
In plugin v0.2.0, hooks/zcode-mem-hook.mjs:8-9:
const RECALL_PROMPT_RE =
/\b(previous|prior|history|remember|decision|like before|regression|release|plugin|connector|sync|hook|thread|memory|context)\b/i;
A prompt like Nowledge Mem 的安装历史和配置 (clearly asking about installation history) does not match, so recall is skipped even when highly relevant memories exist in the store.
Verified fix
Adding a separate CJK alternative group (CJK has no \b word boundaries, so it must not be wrapped in \b(...)):
const RECALL_PROMPT_RE =
/\b(previous|prior|history|remember|decision|like before|regression|release|plugin|connector|sync|hook|thread|memory|context)\b|(之前|以前|上次|历史|记住|记忆|回忆|决策|上下文|还记得)/i;
Tested locally (Windows, plugin 0.2.0, nmem-cli 0.10.76):
- Prompt
Nowledge Mem 的安装历史和配置→ hook injected 2 relevant memories viaadditionalContext✅ - Unrelated prompt
帮我写个函数→ no recall triggered, no output ✅ (false-positive rate unchanged)
Suggestion
A keyword gate is inherently brittle across languages. A more robust long-term option might be to make the gate language-agnostic — e.g. always run a bounded top-3 recall on every prompt (cost is one local search), or derive the trigger from the context bundle rather than a keyword list. The regex patch above is a minimal stopgap.
- Ngôn ngữ chính
- JavaScript
- Star
- 3
- Fork
- 1
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nowledge-co/zcode-plugin
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
nowledge-co/zcode-plugin#2 · 1 bình luận ·
Tất cả issue của nowledge-co/zcode-plugin
Issue tương tự
-
follow-redirects updateĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
mailgun/mailgun.js#544 ·
-
beginner bug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
BistaDinesh03/critique#266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
solana-foundation/solana-web3.js#4015 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: dependencies auto-generated cwe: 405 dependencies ecosystem: npm help wanted package: minimatch scope: runtime security security-alert severity: medium source: dependabot supply-chain vulnerability
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
tdk-landscape/tdk-cli-core#2811 ·
-
a11y bug confirmed issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
open-webui/open-webui#33442 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày