Commit Graph

213 Commits

Author SHA1 Message Date
AskaEth 4424c09759 docs: 插件README修正 — 写明三步注册流程 + go:generate指令 2026-06-25 20:48:15 +08:00
AskaEth 27e7bd0649 docs: ToolProgress 补全 Error + Result 字段 2026-06-24 19:39:10 +08:00
AskaEth 1f633608db docs: 插件开发文档补全 — Stop/Health/Complexity/ComplexTool/ToolDefinition全字段 2026-06-24 19:37:10 +08:00
AskaEth 65ff530ce4 docs: 插件注册方式更新 — plugins.json代码生成替代硬编码 2026-06-24 19:31:49 +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 2e94e7b0bf docs: 插件开发指南 + README清理dev_must_read和pg-backup引用 2026-06-24 19:14:51 +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 cdfe440044 feat: send-proactive 消息记入平台日志 — ethend可见 2026-06-23 21:42:23 +08:00
AskaEth 3a5591833f fix: INSERT VALUES 列数不匹配 — 补齐platform字段 2026-06-23 21:29:41 +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 f7c41f3e23 fix: LLM提醒触发加2次重试 — 避免ai-core繁忙时超时 2026-06-23 21:21:46 +08:00
AskaEth 049332312b fix: reminder LLM触发超时 15s→30s 2026-06-23 21:18:37 +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
AskaEth a3bdeba63a feat: 工具调用全部异步,不再阻塞主会话
- 去掉8s超时同步执行,工具一律走 executeAsyncAndStore
- LLM立即收到[后台执行中]提示,继续生成回复
- 工具结果在下一轮对话中返回

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 20:35:11 +08:00
AskaEth 2ec49f0779 fix: ListReminders JSON解析 — Gateway返{reminders:[...]}而非裸数组 2026-06-23 20:32:10 +08:00
AskaEth edc2e77d2f fix: internal reminder路由+user_id支持 — 修复401/404
- Gateway新增 POST/GET/DELETE /api/v1/internal/reminders
- CreateReminderRequest新增UserID字段,JWT为空时回退
- GatewayClient URL改为 /api/v1/internal/reminders

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 20:24:09 +08:00
AskaEth fea67d05eb fix: reminder工具401认证 — 路由从JWT组迁到internal组
- Gateway新增 /api/v1/internal/reminders (GET/POST/DELETE)
- 使用 X-Internal-Token 认证,不再需要JWT
- GatewayClient URL改为 /api/v1/internal/reminders

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 20:19:23 +08:00
AskaEth d38b92568b feat: 自主思考可按需查看群聊上下文 — 【查看群聊:适配器名:群号】
- 思者可在反思中输出【查看群聊:obv11-main:531082168】主动获取群聊记录
- 查找平台频道表确认adapter名称对应的platform类型
- 通过 memory-service 拉取最近5条频道记忆注入思考
- 自动追加【继续思考】以处理获取到的上下文
- 分析结果保留在思考链中

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 20:12:20 +08:00
AskaEth a2078b6662 feat: 主动消息写回对话历史 — 防止短期重复提问
- storeThought 推送主动消息后写入 convStore
- 轻量思考话题发起后也写入
- 配合提示词规则: 两小时内不重复问同类话题

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 20:01:43 +08:00
AskaEth 1eb22f5d06 fix: blocklist提前到消息处理最前端 — 拦截消息不浪费任何资源
- 移到 logging/enrichment/routing 之前
- 被拦截消息只记一条 [blocked] 日志,不调ai-core
- 时间戳/群名/昵称等富化处理不再对blocked消息执行

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:53:23 +08:00
AskaEth 4733f9c02a fix: 前端追踪时间 — 三处toISOString()全部替换为本地时间
- traceHopHtml 直接用后端格式化好的 timestamp
- llmCallToTrace 用前端 fmtLocal()
- 实时流事件用本地时间格式化
2026-06-23 19:45:16 +08:00
AskaEth f7df659c85 fix: 还原系统时区方案 — 时间戳已自带+08:00 2026-06-23 19:43:43 +08:00
AskaEth 109d427971 fix: 追踪时间强制UTC+8 — 不依赖系统时区 2026-06-23 19:41:43 +08:00
AskaEth f3b588d848 fix: 上下文恢复加24h合理性检查 — 避免用远古记忆当最近活动 2026-06-23 19:38:54 +08:00
AskaEth e0900bdd1b feat: 重启后恢复上下文 — 从记忆服务查询最近活动时间
- 新增 restoreContext() 在 Start() 时查询持久化记忆
- 取最近记忆的 CreatedAt 设为 lastUserMessage
- 避免重启后思考出现"已经一天没说话了"

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:38:08 +08:00
AskaEth 71539b5520 fix: 追踪页面回退到平铺视图,管线聚合待后续优化 2026-06-23 19:34:39 +08:00
AskaEth 87e8f97c1f fix: ethend OBv11配置界面字段丢失 — PLATFORM_FIELDS key qq→obv11
- 配置platform迁移后 PLATFORM_FIELDS['obv11'] 查不到返回空
- 新增 getPlatformFields() 归一化查找,兼容旧qq key
- PLATFORM_ICONS/LABELS/REAL 同步增加 obv11 key

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:28:12 +08:00
AskaEth 222fc5768f fix: send-proactive adapter查找 — 先按名再按平台类型回退 2026-06-23 19:26:12 +08:00
AskaEth 4326f1fc02 fix: seedIdentities 硬编码配置名导致admin身份丢失
- 迁移后配置名 qq→obv11-main,但seed用["obv11"]查不到
- 改为遍历store.List()所有配置,不再硬编码名字
- admin消息不再被当普通人处理而丢失回复

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:23:10 +08:00
AskaEth e433e94c89 fix: 全链路追踪时间显示 — UTC→UTC+8 本地时间
- 新增 formatLocalTime() 替换 toISOString()
- 追踪面板时间显示为北京时间

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:17:32 +08:00
AskaEth a47eeab808 feat: 全链路追踪系统 — ai-core追踪事件 + ethend管道视图
ai-core:
- 新增 TraceEvent 内存环形缓冲区(200条)
- GET /api/v1/trace/events 端点(支持session_id过滤)
- 预置 trace.go 追踪事件定义

ethend:
- trace/recent 聚合 platform-bridge消息日志 + ai-core追踪事件
- 消息按管线分组: msg_received→llm_call→tool_call→msg_sent
- 前端管线卡片视图: 每条消息显示完整处理步骤

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:11:55 +08:00
AskaEth a8fa64325d feat: 全链路追踪增强 + 超时修复
- ethend /api/trace/recent: 新增消息收发事件(platform-bridge日志)
- 消息按管线聚合: msg_received → llm_call → tool_call → msg_sent
- platform-bridge→ai-core超时 120s→180s

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 19:08:16 +08:00
AskaEth 3081ac38e0 fix: seed去重按platform type而非config name — 消除重复obv11 stub 2026-06-23 18:56:28 +08:00
AskaEth 0f180f17c3 fix: 旧配置自动迁移 — 补ID + qq→obv11 + platform_configs.json同步
- load() 自动为无ID旧配置生成唯一标识符
- 自动迁移 platform: qq→obv11, config名 qq→obv11
- platform_configs.json 已迁移: qq→obv11-main
- OBv11 adapter 已连接 (NapCat client模式)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 18:55:36 +08:00
AskaEth 1e2b2525f4 fix: 私聊主动消息路由修复 + 多账号自动适配
- 正则兼容 private_ 前缀: 【OBv11私聊:private_1487720750】
- prompt 显示频道时自动剥离 private_ 前缀
- extractProactiveMessage 自动查 PlatformChannel 表,
  将 target.Platform 从格式key改为adapter实例名
  多账号场景下自动路由到正确adapter

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 18:43:42 +08:00
AskaEth 73f0bf7b3e chore: 清除最后5处硬编码qq引用(注释+配置白名单) 2026-06-23 18:20:33 +08:00
AskaEth 8a3236b8bb refactor: 彻底消除硬编码 qq — 平台标识统一为 obv11
- PlatformName() 返回 "obv11"
- platformFormats key: "obv11"
- 所有 platform == "qq" 检查 → "obv11"
- session prefix: platform_qq_ → platform_obv11_
- env var PLATFORM_CHANNELS: obv11:group:xxx
- ethend 平台标识同步更新
- 注释和测试用例同步

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 18:19:52 +08:00
AskaEth c96bd23f83 feat: PlatformChannel 支持 AdapterID/AdapterName — 多账号全链路区分
- PlatformChannel 新增 AdapterID + AdapterName 字段
- AddOrUpdatePlatformChannel 接受 adapter 信息参数
- channel_sync 传递 adapter_id/adapter_name
- 消息处理路径传递 adapter_name

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 18:01:27 +08:00
AskaEth 45fac267fe feat: 平台配置唯一ID — PlatformConfig.ID + adapter全链路传播
- PlatformConfig 新增 ID 字段 (8字节hex,创建时自动生成)
- QQ adapter 新增 configID + ConfigID() 访问器
- ChannelInfo 新增 AdapterID + AdapterName
- createSingleAdapter 接受 configID 参数
- 同一个平台类型的多个配置实例通过 ID 唯一区分

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 17:59:37 +08:00
AskaEth 6bf59f7eee feat: 频道自动发现 — platform-bridge定时刷新频道路由 + ai-core周期同步
platform-bridge:
- QQ adapter: FetchGroups/FetchFriends 从NapCat API获取
- ChannelLister接口 + ChannelInfo结构体
- GET /api/v1/channels 端点 + cachedChannels缓存
- StartChannelRefresh 每10分钟自动刷新

ai-core:
- channel_sync.go: 每5分钟从platform-bridge拉取频道
- 自动更新thinker的platformChannels + botUIDs
- 不再依赖PLATFORM_CHANNELS环境变量手动配置

修复:
- SendMessage显式设AutoEscape:false
- PLATFORM_BRIDGE_URL默认端口8082→8095
- OBv11Params.AutoEscape去掉omitempty

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 13:12:54 +08:00
AskaEth c9bf839945 fix: QQ发送消息中文乱码 — SendMessage 显式设置 auto_escape=false
NapCat 在 auto_escape 未传时默认走 escape 模式,导致 UTF-8 中文被当 CQ 码处理

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 13:01:21 +08:00
AskaEth caa9bfced5 docs: 工具调用系统介绍文档
- 17个工具完整列表(共享插件 + AI-Core专属)
- 注册机制 + ToolExecutor接口
- 对话中完整调用流程(含LLM API请求/响应示例)
- 工具调用循环(最多5轮)
- 后台思考白名单机制
- 超时异步处理

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 12:53:23 +08:00
AskaEth 9767abae89 feat: 2.2 主动话题发起 — 轻量思考扩展【话题发起】输出
- 轻量思考 prompt 新增话题发起指引
- 检测【话题发起】标记 → 提取内容 → 通过 messagePusher 推送
- 遵循 ProactiveGuard 频率控制

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 12:46:51 +08:00
AskaEth bbf06da00f feat: 1.3 记忆自然引用 — 记忆标签从'数据库检索'改为'自己的回忆'
- 记忆头: '以下是关于开拓者的重要记忆' → '你记得关于开拓者的这些事'
- 分类: '★核心记忆/●常用记忆' → '你很确定的事/最近发生的事/还有点印象的事'
- 增加规则: 禁止用「根据记忆」「检索到」等说法

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-23 12:45:44 +08:00