feat: 命令推断、自动处理管线与统一附件上下文#56
Merged
Merged
Conversation
Allow each LLM config to opt into upstream streaming without changing runtime or WebUI chat protocols. Preserve provider compatibility by aggregating stream responses in the unified requester and falling back to non-stream requests when streaming fails.
- 提示词添加用户识别规则:以 QQ 号为准,称呼用最新昵称 - observations 格式要求:必须包含 QQ 号(昵称会变但 QQ 号不变) - get_member_info 工具新增 brief 参数,支持简洁模式只返回昵称 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 将所有工具返回的 <pic uid="..."/> 改为推荐的 <attachment uid="..."/> - 更新文档中的附件标签说明 - 新增 group.get_avatar 工具:获取 QQ 用户头像返回 UID Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- 添加统一附件标签说明(推荐 <attachment uid="..."/>) - 添加 group.get_member_info brief 参数说明 - 添加 group.get_avatar 工具说明 - 添加用户识别规则与提示词约定 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…th subcommands and auto-inference
…emove internal permission checks - Extend CommandMeta/SubcommandMeta with subcommands and inference fields - Add SubcommandInferenceRule/SubcommandInference dataclasses in registry.py - Implement resolve_subcommand() with explicit match + inference (default/rules/fallback) - Dispatcher: apply subcommand permissions/rate_limits before handler invocation - Add CommandContext.check_permission() and resolved_subcommand for handler use - Migrate faq: config.json subcommands + inference, handler simplified - Migrate naga: config.json subcommands, delete scopes.json + _check_scope() - Migrate profile: use context.check_permission() instead of direct config check - Update /help: compact list format, subcommand detail with inference hints - Sync all documentation: slash-commands.md, usage.md, READMEs - Add tests for registry inference, context permission checks
The ai_draw_handler now returns the unified <attachment uid="..."/> tag, aligning with the attachment system migration. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
为所有接受 QQ 号参数的斜杠命令(/addadmin、/rmadmin、/profile、/bugfix) 支持真 @ 提及,例如 /addadmin @某人 等价于 /addadmin 1234567。 实现策略:在命令解析层 (services.command.parse_command) 统一归一化, 命令实现侧无需任何改动,仍按纯数字处理参数。 - services/command.py: * parse_command 仅剥离开头的 @ 机器人提及(保留参数中的真 @) * 新增 _normalize_qq_arg:自动把 [@qq]/[@qq(昵称)]/[@{QQ}] 归一化为 纯数字 QQ 号,注入到 args 列表中 - 各 command handler 保持原状(仅文档/提示语轻微调整) - 同步更新 4 份 config.json 的 description/usage/example - tests: 新增 test_command_qq_arg.py 覆盖归一化与 parse_command 行为 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v3.3.3 命令推断、自动处理管线与统一附件上下文
本版本重点优化了命令系统的交互体验、AI 工具边界和消息前置处理链路。新增 GitHub 链接自动卡片生成,并将 Bilibili、arXiv、GitHub 等自动提取迁入
skills/auto_pipeline热重载管线,使预处理结果能写入历史并进入后续 AI 回复上下文。同时,帮助说明与用户侧写默认改为图片输出,系统剥离独立群聊分析工具集,全面推行统一附件标签,并为远程附件加入可配置下载上限和 URL 引用降级,完善底层用户识别机制与模型高级透传配置。/faq合并了列表、阅读、搜索与删除入口,可自然理解省略部分参数后的交互意图。/help与/profile默认渲染为图片分发,避免长内容刷屏;保留-t参数用于强制返回纯文本,/profile仍支持-f合并转发模式。skills/auto_pipeline下提供config.json + handler.py结构,支持热重载、并行检测和并行处理多个命中结果;首批内置 Bilibili、arXiv、GitHub 三条管线,且斜杠命令优先级高于自动管线,命中命令后不会触发后续自动提取或 AI 自动回复。owner/repo标识,自动生成包含项目简介、Stars、Forks、贡献者等信息的卡片;支持独立开关与白名单控制,并裁剪渲染截图底部空白。pic_*/file_*UID,并记录群合并转发摘要,后续 AI 回复可直接看到这些结果并用<attachment uid="..."/>引用附件。[attachments].remote_download_max_size_mb控制外部远程附件缓存大小,超过上限或配置为0时只登记 URL 引用,避免大文件导致磁盘占用和消息处理延迟激增。group_analysis.*集合,避免日常查询与复杂分析导致的 AI 工具边界混淆。<attachment uid="..."/>作为标准分发标签(继续兼容旧<pic>),配套统一了表情包提示词,新增group.get_avatar头像专用工具。group.get_member_info(brief=true)快速拉取当前昵称,有效解决群友频繁更换名片引发的识别错乱。stream_enabled独立控制推流行为,增加request_params以支持向不同厂商端点透传特殊参数。render.py为浏览器实例单例复用模式,并引入可配置的并发信号量,防止低资源设备多任务抢占导致截图超时。matplotlibmathtext 渲染,复杂内容再回退 MathJax + Playwright,避免简单公式依赖外部网络或系统 TeX 环境。