Commit Graph
592 Commits
Author SHA1 Message Date
moesnow 395f124299 fix(mcp): mark query tools as read-only 2026-10-24 16:26:22 +08:00
moesnow faed80c898 fix(mcp): retain fallback for unsupported array items 2026-10-21 21:05:50 +08:00
moesnow 47129958dd fix(mcp): preserve primitive array parameter types 2026-10-21 21:05:50 +08:00
KokerZhou 0edc64d99a fix(settings): allow memory as the default session tab (#494) 2026-10-12 20:50:43 +08:00
79117ebf0c fix(semantic-index): return global Response from proxied model downloads
When a model download proxy is configured, createProxyFetch() returned the
Response from undici's own fetch, which is not the global Response.
Transformers.js only writes `instanceof Response` results to its file cache,
so the ONNX weights were never cached and preload failed with "Unable to get
model file path or buffer." Keep undici's fetch and ProxyAgent, and re-wrap the
response body stream in a global Response.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-09-28 17:11:11 +08:00
digua eadadda071 feat(electron): add persistent UI scale setting 2026-09-28 16:59:25 +08:00
digua 3e0e0fbbfb fix(sync): protect data source configuration from failed writes 2026-09-24 10:15:02 +08:00
digua af0e844f8a fix(storage): avoid rewriting satisfied data directory compatibility markers 2026-09-24 10:11:59 +08:00
digua 80fcaa7ea2 fix: preserve complete session loading error details 2026-09-23 11:36:38 +08:00
Sanssssssssssssssss 83c28c026f fix(ai): bound cumulative tool results per request (#464)
每次模型请求前检查总预算并裁剪工具结果副本,保留原记录、调用配对和计费,避免并行或跨轮结果累积超窗。
Fit cumulative tool results before each model request while preserving the transcript, call pairing and usage.

Verified with 121 related tests, 40 stress scenarios, Pi HTTP failure injection and independent reviews.
2026-09-22 18:47:38 +08:00
digua b50c495e7d fix(ai): handle Qwen topic reasoning and output limits 2026-09-22 18:36:13 +08:00
digua 45cfe87037 fix(ai): complete analysis time parameter metadata 2026-09-22 18:23:42 +08:00
Chris ChengandClaude Opus 5 6e27968bb0 feat(tools): localize tool descriptions by locale for every runtime
Tool and parameter descriptions were handed to the LLM in Chinese on every
runtime regardless of locale: the English metadata table in
packages/tools/src/tool-metadata.ts had no caller, the desktop translateTool
looked up i18n keys that exist in no locale file, and the MCP server had no
locale at all.

Fill the table for every tool whose definition text is Chinese (37 entries,
only translating what the definitions write in Chinese so the two copies
cannot drift), and route the four consumers through getLocalizedToolMetadata:
the cross-chat agent adapters, the CLI Web agent adapter, the desktop shared
tool adapter (replacing the dead translateTool), and the MCP server, which
now resolves its locale from config.locale.lang or the system locale for both
the standalone binary and the chatlab mcp subcommand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 16:54:06 +08:00
digua 2e385bd401 fix(ai): preserve system role for Qwen chat completions 2026-09-22 10:51:11 +08:00
digua 14c9defdf1 fix(query): use indexed ranges for message context 2026-09-21 18:51:50 +08:00
digua 29c184387e fix(query): reuse chronological segment context per search
Sort each indexed segment once per request instead of scanning and sorting it for every hit. Preserve backfilled chronological neighbors and segment boundaries in both query adapters, with a large-segment regression test.
2026-09-21 18:51:50 +08:00
Sanssssssssssssssss 20199345ba fix(query): preserve chronological context after backfill
补导历史后按时间和 ID 选取相邻消息,保留分段边界并补充回归测试。
Select neighbors by timestamp and ID after backfill; preserve segment boundaries and add regressions.
2026-09-21 18:51:50 +08:00
liuyy2 a57009d56f docs(ai): clarify analysis time parameter precedence 2026-09-21 18:45:55 +08:00
liuyy2 aea7e2540c fix(ai): respect time ranges in analysis tools 2026-09-21 18:45:55 +08:00
digua db4ce30852 fix(ai): persist truncated turns across chat entry points
Preserve partial output and token usage in CLI turns and edited UI rounds while leaving ordinary failures and cancellation unchanged. Use OutputLimitError across agent runners so incomplete turns remain visibly unsuccessful but can be reloaded and continued.

Cover real stream handling, SQLite persistence, reload, CLI continuation, and unsuccessful one-shot JSON output.
2026-09-18 10:53:06 +08:00
digua 1388aaccf7 fix(ai): handle model output truncation 2026-09-18 10:53:06 +08:00
ttsdj 89974f34e3 fix(cache): keep download writes inside the downloads directory
POST /_web/cache/save-to-downloads joined the caller-supplied `filename`
straight into the downloads directory:

    const filePath = path.join(downloadsDir, filename)

`path.join` collapses `..`, so `{"filename":"../escaped.txt"}` resolved
one level above the downloads directory and the route wrote
attacker-chosen bytes there, returning `{ success: true }`. Any client
that can reach the route could therefore write outside the downloads
directory as the app user.

The route is registered by the shared web routes on both CLI Web and the
Electron internal API, so the fix covers both. Its own siblings already
constrain this input — merge.ts and the CLI upload route both run the
name through `path.basename` — so the missing guard here was an
oversight rather than a documented allowance.

Reject anything that is not a plain file name, and join only the
validated basename. Names the app itself sends stay unchanged: every
caller (conversation export, SQL export, screen capture) already passes a
flat file name.
2026-09-10 16:17:10 +08:00
digua b9903e77e6 feat(analytics): track deliberate insight tab visits after dwell 2026-09-08 15:52:11 +08:00
digua 16cbdb96b6 fix(analysis): preserve bracketed annotations in language profiles
Reusing emoji cleaning also removed ordinary bracketed labels from language vocabulary. Preserve unknown bracketed text for language profiles while retaining known emoji filtering and the existing word-frequency behavior. Add a regression for annotated chat messages.
2026-09-06 01:19:44 +08:00
babybitter 6191956338 feat(analysis): recognize Douyin export emoji codes
补充抖音导出表情代码识别表,让文本分析把 [微笑]、[星星眼]、[666]、[V5]、[kisskiss] 等带方括号的抖音表情代码当作表情,而不是普通文本词汇。

新增平台表情代码数据模块 bracket-emoji,集中管理微信经典表情映射与从抖音导出中收集到的表情代码名(含此前的 [躺平]、[强壮]);cleanText 按 [代码]/【代码】 形式识别已知平台表情代码并在清洗时剥离。此前非中文名的抖音表情代码(如 [V5]、[ok]、[kisskiss])会被当作普通词汇进入词频统计;语言偏好分析的分词清洗也改用与词频一致的 cleanText,表情代码不再混入高频词,而口头禅与短语统计仍保留 [表情] 原始形式。

补充脱敏合成数据回归测试,覆盖括号格式文本清洗、Node 与 Browser 词频统计以及语言偏好分析;新测试在识别逻辑缺失时会失败。

(cherry picked from commit c80885e0e3)
2026-09-06 01:17:13 +08:00
digua 4392519d30 fix(analysis): omit members without repeated catchphrases
Voice transcription normalization can remove every phrase for a member while leaving an empty member entry. Filter those entries from the result so overview and selected-member views retain their empty states.

Add a regression test for single-use transcriptions alongside another member with valid catchphrases.
2026-09-04 00:27:29 +08:00
babybitter 8b7d62e248 fix(analysis): separate system messages from emoji phrases
区分抖音导出中的显式系统通知、分享占位和用户表情,避免系统提示进入口头禅及语言、词频统计。

新增统一的系统/分享前缀识别,覆盖 [系统]、[系统消息]、[分享内容] 及对应全角和英文形式;不误判 [强壮]、[躺平] 等表情标签。口头禅、语言偏好以及 Node/Browser 词频分析支持文本与表情消息,并在统计阶段排除系统通知和分享占位;原始聊天记录保持不变。

补充脱敏合成数据回归测试,覆盖系统通知、分享内容占位排除以及表情保留。
2026-09-04 00:19:21 +08:00
babybitter 0c34853066 feat(analysis): support voice transcriptions in ChatLab
适配导入文件中的语音转写内容,让 ChatLab 在语言分析、词频统计和口头禅分析中使用实际转写文字,而不是把语音时长标签当作文本。

识别并移除语音消息前的时长标签,保留转写内容;纯语音占位符继续从文本分析中排除。

统一桌面端、CLI Web 和 Web WASM 使用的文本清洗逻辑,并补充 ChatLab JSONL 导入、词频、语言偏好和口头禅分析测试。

测试使用脱敏后的合成消息,不包含个人聊天记录。
2026-09-04 00:19:21 +08:00
digua f8e482e2a9 fix(relationships): release session databases during graph compute 2026-08-29 09:25:54 +08:00
digua 1566cfcb2b refactor: prune dead compatibility surfaces 2026-08-28 23:56:25 +08:00
Sanssssssssssssssss 02b9ccb59f fix(ai): enforce the tool round limit
Stop after one final-answer turn and pin Pi 0.84.2 for the public stop hook.
到达工具轮次上限后只允许一轮终答,并锁定提供公开停止钩子的 Pi 0.84.2。
2026-08-28 22:33:10 +08:00
Sanssssssssssssssss e544392a83 fix(ai): preserve explicit tool errors
Promote resolved tool error flags through Pi's formal tool-result contract.
将工具返回的错误标记提升为 Pi 正式错误结果,避免错误被记为成功。
2026-08-28 22:33:10 +08:00
Sanssssssssssssssss 90bf3b6400 fix(ai): preserve active turn context ownership
Avoid aliasing Agent state into the Pi loop, which duplicated finalization messages.
避免将 Agent 状态数组交回 Pi 循环,防止终局消息被重复写入。
2026-08-28 22:33:10 +08:00
KokerZhou 758b0667fc feat(docker): preinstall default NLP dictionary 2026-08-28 22:24:13 +08:00
digua e2723cf751 refactor(web): remove Web WASM AI runtime 2026-08-28 14:34:59 +08:00
KokerZhou e3c2e8ec58 feat(cli): support Unix domain socket listener 2026-08-28 10:21:39 +08:00
digua b7c38fb228 fix(insight): bound graph look-ahead allocation
Clamp cluster look-ahead values at the shared core boundary so invalid inputs cannot create oversized candidate matrices. Add a regression test that keeps oversized values equivalent to the supported maximum.
2026-08-28 10:18:54 +08:00
digua 4a3a72e736 perf(insight): reduce session graph memory usage 2026-08-28 10:18:54 +08:00
digua dcee433174 fix(import): preserve fallback message multiplicity
Preserve repeated same-second WeFlow and EchoTrace messages while consuming existing fallback occurrences one for one across overlapping imports and merged sources.
2026-08-27 17:19:06 +08:00
digua af68f13d09 fix(import): avoid deduplicating WeFlow local IDs 2026-08-27 17:19:06 +08:00
digua cb7ba1f3cc fix(ai): refresh memory source parent after compression
Capture the conversation active message when the agent turn completes so an automatically persisted compression summary becomes the expected parent for the pending user message. Add an integration regression covering summary persistence, memory creation, message-pair persistence, and source linking.
2026-08-26 22:23:04 +08:00
digua 63c5cc2b46 fix(ai): keep memory provenance through long turns
Remove the wall-clock expiry from in-flight memory provenance so long agent investigations can still link memories to their source messages. Clean up completed turns without memory changes immediately and retain changed turns until the client consumes them.
2026-08-26 22:23:04 +08:00
digua f4017b0adf feat(ai): link memories to source messages 2026-08-26 22:23:04 +08:00
digua cc240c85f5 fix(ai): limit editing to latest turn
Keep compression summaries before the in-flight question and let the Node runtime validate and atomically replace only the terminal question-answer round.
2026-08-26 21:48:10 +08:00
digua f35e41ca70 test(ai): use supported module mock exports
Use Node's namedExports option so the optional Jieba regression test remains valid under the current node:test type definitions.
2026-08-26 21:48:10 +08:00
digua 9378029acb fix(ai): persist edited turns atomically
Replace the edited user message, old assistant response, and regenerated response in one SQLite transaction. This prevents a failed replacement insert from leaving a partially rewritten conversation.
2026-08-26 21:48:10 +08:00
Sanssssssssssssssss 893f1c05ec fix(ai): persist conversation turns atomically
中文:将用户与助手消息合并为单事务写入,失败时不再留下孤儿消息或误报成功。

English: Persist user and assistant messages in one transaction so failures leave no orphaned turn or false success.
2026-08-26 21:11:35 +08:00
Sanssssssssssssssss 0126b56648 fix(ai): keep equal-timestamp compression boundaries intact
中文:避免同秒消息跨摘要边界,防止已压缩内容重复回放或后续消息丢失。

English: Keep equal-timestamp messages on one boundary side so compressed content is not replayed and later messages remain visible.
2026-08-26 21:06:01 +08:00
digua 4d6acc97e5 fix(ai): harden global memory relevance ranking
Use dependency-independent Chinese tokenization, preserve prompt capacity for the highest relevance match, and handle short symbolic and numeric terms without distorting bounded recall.
2026-08-26 13:46:58 +08:00
digua 4b405b8114 feat(ai): rank global memories by relevance 2026-08-26 13:46:58 +08:00