AskaEth
|
02852347d9
|
feat: n-gram文本相似度作为embedding降级方案
SimpleEmbedder重写为基于字符bigram+trigram的FNV哈希向量:
- 相似中文短语共享n-gram → 余弦相似度有意义
- 不需要任何外部API,纯本地计算
- 作为EMBEDDING_API_URL不可用时的自动降级
keywordSearch升级为滑动窗口分词匹配:
- 2-4字窗口切分查询词,分别匹配记忆内容/摘要/标签
- 按匹配分数降序排列,分数越高越相关
- 替代原来的完整字符串包含匹配,中文召回率大幅提升
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-06 20:46:40 +08:00 |
|
AskaEth
|
9b0c05f03d
|
fix: 记忆嵌入兼容性 + 管理员称呼 + 记忆归因三大修复
记忆嵌入修复:
- 新增 EMBEDDING_API_URL/EMBEDDING_MODEL 环境变量,嵌入端点可独立配置
- 启动时测试嵌入API可用性,不可用则自动降级为关键词匹配并记录日志
- DeepSeek等不提供embedding的API不再静默失败
管理员称呼修复:
- 管理员消息nickname不再包含数字UID,防止LLM用QQ号称呼
- 管理员身份提示中加入名字并强调禁止使用数字ID
记忆归因修复:
- persona注入新增规则10:记忆归属——群友的事不是开拓者做的
- persona注入新增规则11:禁止用数字ID称呼人
- 群聊规则新增7/8条:不要张冠李戴、用昵称不用数字
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-06 20:42:40 +08:00 |
|
AskaEth
|
2499ca862d
|
feat: 禁止在聊天平台生成代码/长文等大量文本
- persona注入规则新增第9条:严禁答应代码/长文生成请求
- 群聊规则新增第6条:严禁生成代码/长文(管理员也不破例)
- 明确告知后续本地工作助手插件会上线这些能力
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-05 14:29:18 +08:00 |
|
AskaEth
|
f723194a17
|
fix: group_ambient模式区分管理员和非管理员审查提示
管理员在群里说话不@bot时,group_ambient审查提示不应限制其工具使用权限。
现在管理员走「群聊审查模式-管理员」提示,允许正常使用工具;
普通群友仍然走严格审查,防止随意插话。
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-05 13:40:43 +08:00 |
|
AskaEth
|
13a2c69d5e
|
fix: 修复记忆力差和跨群聊上下文泄漏
记忆嵌入修复:
- 新增 memory.APIEmbedder 使用 text-embedding-3-small 替代 SimpleEmbedder
- Extractor 保存记忆时自动生成向量嵌入
- Embedder 接口增加 IsAvailable() 方法
跨群聊上下文隔离:
- Thinker 新增 thinkSessionID 字段,performThink 启动时绑定会话
- storeThought 优先使用绑定的 session 推送思考结果
- 防止思考过程中其他群消息改变 activeSessionID 导致串台
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-03 12:25:05 +08:00 |
|
AskaEth
|
197c86fa72
|
fix: 修复 web_search 搜索超时和噪音问题
- 移除baidu/360search引擎(安全验证拦截),保留bing+sogou
- 超时从10s增加到25s,SearXNG内部timeout=20s
- 添加User-Agent
- 跳过失败的工具结果推送,避免"百度被安全验证挡住"等噪音刷屏
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-03 12:02:46 +08:00 |
|
AskaEth
|
e26501b25d
|
fix: 强制简体中文输出,防止群友繁体昵称传染
- persona/injector.go: 对话风格规则中加入简体中文强制要求
- orchestrator/synthesizer.go: 群聊规则中加入简体中文强制要求
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-07-02 21:32:49 +08:00 |
|
AskaEth
|
efcd97e98f
|
fix: TLS连接池复用 + 禁言检测 + 降级回复静默
- llm/openai.go: 移除DisableKeepAlives,启用连接池(100idle/20perhost/90s)
修复频繁TLS握手超时问题
- qq/adapter.go: 监听group_ban通知,发送前检查禁言状态
防止向被禁言群发消息导致风控
- cmd/main.go: 降级回复仅管理员私聊,群聊静默失败避免怪话
- protocol.go: OBv11Message新增Duration字段
- bridge/router.go: 处理noticeToUnified返回nil(内部消费的通知)
|
2026-07-02 20:31:08 +08:00 |
|
AskaEth
|
ddb1120ee1
|
fix: buildThinkingUserPrompt嵌套锁死锁 + 管理员群聊路由优化
- thinker.go:1662/1762 defer t.muUnlock→立即解锁,消除buildThinkingUserPrompt自死锁
(1662持锁后1762再Lock→同goroutine自死锁→23h锁泄露→3769 goroutine泄漏)
- platform-bridge: 管理员在群里@别人走group_ambient而非normal,避免频繁插嘴
|
2026-06-30 12:41:24 +08:00 |
|
AskaEth
|
88755e131a
|
fix: 工具名过滤、消息拆分提示词优化
- filterActions: 过滤DeepSeek直接输出工具名(如vision_analyze)的怪话
- 系统提示词: 明确告知用双换行(空行)拆分多条消息
- 群聊规则: 加入独立想法用双换行分隔的说明
|
2026-06-29 12:57:21 +08:00 |
|
AskaEth
|
44048b333a
|
fix: 死锁修复、管理员权限集中管控、群聊频率控制、表情映射修复
thinker.go: 移除所有 defer t.muUnlock() 持锁跨阻塞调用的模式,消除8处死锁点
- performThink: defer→立即解锁,LLM调用不再持锁
- lightThinkLoop: defer在for循环内→第2次迭代自死锁
- resetSilenceTimer: defer持锁调performThink
- UpdatePresence: defer持锁调time.Sleep+performThink
- storeThought: defer+panic→锁泄露; 移除extractProactiveMessage嵌套锁
is_admin三层防御:
- synthesizer: 系统提示词注入管理员/非管理员身份标签
- iot_provider: 非管理员直接拒绝IoT操作
- plugin-manager: ToolDefinition.AdminOnly自动拦截,集中管控
群聊优化:
- group_ambient: 强化审查指令,【不发送】自审查标签
- 群聊间隔4s→3s,最多2条/轮
- 工具失败也推跟进消息,避免沉默
平台桥接:
- 日志文件名使用适配器唯一标识符(ConfigName)
- QQ表情映射替换为官方116条目数据
- CQ表情保留名称/ID
|
2026-06-28 20:22:09 +08:00 |
|
AskaEth
|
236dbfcc92
|
fix: 删除performThink中孤儿muUnlock
|
2026-06-28 17:22:30 +08:00 |
|
AskaEth
|
d63322244c
|
fix: performThink defer unlock改回立即unlock——LLM调用期间不能持锁
|
2026-06-28 17:19:03 +08:00 |
|
AskaEth
|
d4c246fa0c
|
fix: 移除有问题的runtime.SetFinalizer
|
2026-06-28 17:07:24 +08:00 |
|
AskaEth
|
76e648aac3
|
fix: 回退thinker.go到6490c34稳定版
|
2026-06-28 16:58:55 +08:00 |
|
AskaEth
|
32160d9453
|
fix: 回退muLock为简单版本,保留deadlock监控
|
2026-06-28 16:57:36 +08:00 |
|
AskaEth
|
1d4560e676
|
fix: PROACTIVE_MSG_MIN_GAP_SEC=0 写入.env
|
2026-06-28 16:37:25 +08:00 |
|
AskaEth
|
1f52b424e1
|
fix: 主动消息默认频控1分钟
|
2026-06-28 16:36:07 +08:00 |
|
AskaEth
|
2835d62d41
|
feat: 主动消息频控默认关闭 (0=disabled, 设秒数开启)
|
2026-06-28 16:35:39 +08:00 |
|
AskaEth
|
6490c341e5
|
fix: 主动消息频控从30分钟降到5分钟 + 拦截后清除标记防止LLM幻觉
|
2026-06-28 16:34:47 +08:00 |
|
AskaEth
|
d196a22f42
|
fix: 所有muLock改为defer unlock防止panic孤儿锁
|
2026-06-28 16:27:40 +08:00 |
|
AskaEth
|
24d7722ef9
|
fix: storeThought orphaned lock → defer unlock
|
2026-06-28 16:16:35 +08:00 |
|
AskaEth
|
dc410c1cff
|
debug: 死锁监控+DebugMutex+ChSend+GoStart 调试工具
|
2026-06-28 13:01:54 +08:00 |
|
AskaEth
|
537e4ed550
|
feat: 群聊非@消息走审查模式—值得插话才回
|
2026-06-28 12:17:03 +08:00 |
|
AskaEth
|
bebacf805b
|
fix: 使用Data字段返回权限拒绝提示给LLM
|
2026-06-28 12:13:13 +08:00 |
|
AskaEth
|
ca43604eba
|
fix: IoT权限拒绝改为LLM生成自然回复
|
2026-06-28 12:12:33 +08:00 |
|
AskaEth
|
56b105a1dc
|
fix: IoT控制双层权限 — LLM先行判断 + 代码兜底拦截
|
2026-06-28 12:10:53 +08:00 |
|
AskaEth
|
310a8733c8
|
fix: IoT设备控制仅限管理员
|
2026-06-28 12:06:09 +08:00 |
|
AskaEth
|
1e652b5f32
|
fix: 主动消息禁止编造场景 + 同步推送到QQ
|
2026-06-28 11:53:46 +08:00 |
|
AskaEth
|
a47c8be77b
|
fix: 主动消息同步推送到平台适配器(QQ)
|
2026-06-28 11:52:43 +08:00 |
|
AskaEth
|
2b3aa45547
|
fix: saveToDB 改为同步写,防止进程被杀时消息丢失
|
2026-06-28 11:44:42 +08:00 |
|
AskaEth
|
dfd6ccbd41
|
fix: 移除 DuckDuckGo 回退,web_search 仅用 SearXNG
|
2026-06-28 11:42:14 +08:00 |
|
AskaEth
|
6553656c9a
|
fix: web_search 走本地 SearXNG 而非 DuckDuckGo
|
2026-06-28 11:41:12 +08:00 |
|
AskaEth
|
9b20f14ab9
|
fix: emitToolProgress recover on closed channel
|
2026-06-28 11:36:27 +08:00 |
|
AskaEth
|
5725075a31
|
fix: LoadFromDB Timestamp 赋值 + restoreContext 查20条消息
|
2026-06-28 11:32:17 +08:00 |
|
AskaEth
|
29f24b3036
|
fix: restoreContext 从会话历史取最近活动时间,不再用记忆条目时间
|
2026-06-28 11:30:15 +08:00 |
|
AskaEth
|
fd44b15d81
|
feat: 全链路优化 — 死锁修复、MD3主题、上下文持久化、群聊自然化、打字状态、知识库
**死锁根因修复**
- periodicThinkLoop:1015 orphaned lock → 删除(字段已原子化)
- RecordUserMessage 隔离为 recordMu
- atomic.Int64 替换 lastUserMessage/lastThinkTime 等
**MD3 / Android 17 主题**
- 毛玻璃卡片 (backdrop-filter)
- MD3 色彩令牌 (pink primary #f472b6)
- icons.js 独立矢量图标库 + 运行时 emoji 替换
- 无边框卡片、圆角按钮、阴影层次
**上下文持久化**
- AddMessage → saveToDB 异步写 PostgreSQL
- LoadFromDB 恢复 (admin-session-main + 懒加载)
- LLMMessage.Timestamp 字段
**群聊与适配器**
- group_ambient 模式: 非@消息让 LLM 自己判断是否插话
- 戳一戳动作消息总是回复
- NapCat 打字状态 (set_input_status, 最小3秒显示)
- HTTP API 配置 (http_url/http_token)
**知识库 & 防编造**
- knowledge.CanHandle 对 chat 意图也触发
- 关键词预筛选避免无关 embedding 调用
- persona + synthesizer 三重诚实规则
- 工具结果持久化到会话历史
**平台桥接器**
- detached:true Go进程独立存活
- ethend 重启自动接管已运行服务
- stop() 接管模式 taskkill/F/ PID
- Windows netstat 替代 fuser 获取 PID
- 重复适配器种子逻辑修复
- 失败转发日志 Direction: error
**崩溃诊断**
- crashlog 包 (Recover + WrapHTTP + LLMCall)
- /api/v1/debug/goroutines 端点
- thinker 操作日志 + 30s stats
- 日志写入 logs/ 目录持久化
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-28 11:29:29 +08:00 |
|
AskaEth
|
0d6970a2d3
|
fix: halo_publish 插件 — runtime.Caller 解析config.json绝对路径
|
2026-06-26 12:57:50 +08:00 |
|
AskaEth
|
839522e1d4
|
fix: web_search nil pointer崩溃 — 零值struct→构造函数
- WebSearchPlugin/HTTPPlugin/WebFetchPlugin/FilePlugin
全部改用构造函数创建,避免内部http.Client为nil
- 根因: executeAsyncAndStore异步执行时零值struct导致panic
- ai-core频繁崩溃的直接原因
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-26 12:51:33 +08:00 |
|
AskaEth
|
4424c09759
|
docs: 插件README修正 — 写明三步注册流程 + go:generate指令
|
2026-06-25 20:48:15 +08:00 |
|
AskaEth
|
cfebf5480e
|
feat: 插件自动发现 — plugins.json + 代码生成器
- plugins.json 配置文件列出所有插件及其import路径
- gen_plugins.go 读取配置生成 plugins_gen.go
- main.go 调用 registerPlugins() 替代硬编码列表
- 新增 backend/plugins/ 第三方插件目录
- 插件开发文档: docs/api/plugin-development.md
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-24 19:30:52 +08:00 |
|
AskaEth
|
ebd6f40425
|
feat: 后台思考可被前台消息中断 — 用户发消息时cancel运行中的思考
|
2026-06-24 18:21:36 +08:00 |
|
AskaEth
|
fab934fb12
|
feat: performThink 10s休闲检查 + IsUserRecentlyActive — 后台让步前台
|
2026-06-23 21:52:02 +08:00 |
|
AskaEth
|
e83bd6febb
|
feat: 后台思考让步前台 — 用户10s内有活动则跳过非post_chat思考
|
2026-06-23 21:44:31 +08:00 |
|
AskaEth
|
7e0268a884
|
fix: reminder platform 改用 AdapterName(唯一标识符),不再硬编码 obv11
- ProcessParams/SynthesizeParams 新增 AdapterName
- main.go 传递 req.Source.AdapterName
- reminder_create 自动注入使用 adapter 名而非平台类型
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-23 21:27:02 +08:00 |
|
AskaEth
|
c75ddc13ea
|
fix: SynthesizeParams 加 ChannelID
|
2026-06-23 21:24:19 +08:00 |
|
AskaEth
|
27a497e397
|
feat: 群聊提醒 — 提醒关联平台/频道/适配器,到期发回原群聊
- reminder_create 新增 platform/channel_type/channel_id/adapter_name 参数
- Gateway Reminder 模型 + DB 迁移 + CRUD 全部支持新字段
- 提醒到期时:群聊提醒 → platform-bridge 发回原群聊
- 非群聊提醒 → 走 Web 端推送
- Thinker 新增 PushPlatformMessage 方法
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-23 20:57:58 +08:00 |
|
AskaEth
|
680696e2c4
|
fix: 工具结果推送 userID为空→回退adminUserID
|
2026-06-23 20:50:33 +08:00 |
|
AskaEth
|
01feb16262
|
feat: 异步工具结果主动推送 — 通用回调机制
- Synthesizer 新增 resultPusher 回调字段
- executeAsyncAndStore 完成后自动推送结果
- Orchestrator.SetToolResultPusher 透传
- 回调通用设计,不绑定特定工具
Co-Authored-By: Claude <noreply@anthropic.com>
|
2026-06-23 20:42:55 +08:00 |
|
AskaEth
|
30d5b9b464
|
fix: 重新应用工具异步执行 (被git checkout丢失)
|
2026-06-23 20:39:51 +08:00 |
|