8 Commits

Author SHA1 Message Date
oudecheng
694b3ce0e0 fix: send_session_message 增加详细 debug 日志和文件名归一化匹配
- filename_matches_target 关键日志从 trace 升级到 debug
- 增加 on-disk bytes hex dump 输出,便于定位编码差异
- UTF-8 解码成功但不匹配时继续尝试 GBK 解码
- 新增 normalize_filename() 去除空白/零宽字符后模糊比对
  解决 LLM 在中文文件名中多插空格的问题

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 09:44:47 +08:00
oudecheng
0de0b93896 feat: send_session_message 支持非 UTF-8 编码中文文件路径回退
Linux 环境下,当文件名包含非 UTF-8 编码的中文字符(如 GBK)
时,LLM 从 bash ls 输出获取的 UTF-8 路径无法匹配磁盘上的实
际字节,导致文件访问失败。

此提交新增 resolve_attachment_path() 函数,采用目录扫描+
多编码解码匹配策略:
1. 先按 UTF-8 原样访问(快速路径)
2. 失败后列出父目录,对每个文件尝试 UTF-8/GBK/lossy 解码
   与目标文件名比对,匹配成功则返回磁盘实际路径

同时修复 file_name 提取使用 to_string_lossy() 替代 to_str()
避免非 UTF-8 文件名静默丢失。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 09:27:18 +08:00
oudecheng
a2c4bf1d8c feat: 优化附件路径解析,增加文件名匹配逻辑以支持非 UTF-8 编码 2026-06-11 09:15:05 +08:00
oudecheng
0646a17073 feat: 添加附件路径解析功能,支持非 UTF-8 编码文件名的回退机制 2026-06-10 18:07:17 +08:00
oudecheng
44e82e8473 feat: 附件通过 base64 内容实现前端直接下载
- MediaItem/MediaSummary 新增 content_base64 和 file_name 字段
- 解析附件时读取文件内容并 base64 编码(限 50MB),前端 Blob 下载
- 创建 Session 后返回完整 topics 列表,前端侧边栏实时同步
- 简化话题历史加载逻辑,不再回退到 session 消息

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:01:37 +08:00
oudecheng
efc8af12eb feat: 添加参数提取工具函数,支持处理字符串化 JSON 数组,优化技能管理和会话发送功能 2026-05-21 17:00:22 +08:00
597881f72e feat: Implement WeChatBot SDK with error handling and message protocol
- Add WeChatBotError enum for error handling with various error types.
- Create a Result type alias for easier error management.
- Implement ILinkClient for low-level API interactions including QR code generation, message sending, and updates retrieval.
- Define message types and structures for handling incoming messages and media content.
- Add tests for error handling and message parsing to ensure reliability.

Co-authored-by: Copilot <copilot@github.com>
2026-05-06 14:18:47 +08:00
260266b90f feat: 添加会话消息发送工具,支持文本和附件的发送,优化消息发送逻辑 2026-05-02 09:15:36 +08:00