Skip to content

Dev#1656

Merged
SengokuCola merged 7 commits into
mainfrom
dev
May 7, 2026
Merged

Dev#1656
SengokuCola merged 7 commits into
mainfrom
dev

Conversation

@SengokuCola
Copy link
Copy Markdown
Collaborator

@SengokuCola SengokuCola commented May 7, 2026

  • ✅ 接受:与main直接相关的Bug修复:提交到dev分支
  • 新增功能类pr需要经过issue提前讨论,否则不会被合并
  • 🌐 i18n 提醒:除 bootstrap 或紧急修复外,请不要把非 zh-CN 目标翻译作为常规 GitHub 编辑面;常规翻译以 Crowdin -> l10n_* PR 回流为准,详见 docs/i18n.md

请填写以下内容

(删除掉中括号内的空格,并替换为小写的x

    • main 分支 禁止修改,请确认本次提交的分支 不是 main 分支
    • 我确认我阅读了贡献指南
    • 本次更新类型为:BUG修复
    • 本次更新类型为:功能新增
    • 本次更新是否经过测试
    • 如果本次修改涉及 src/A_memorix,我确认已阅读 src/A_memorix/MODIFICATION_POLICY.md,不涉及则无需勾选
  1. 请填写破坏性更新的具体内容(如有):
  2. 请简要说明本次更新的内容和目的:

其他信息

  • 关联 Issue:Close #
  • 截图/GIF
  • 附加信息:

Summary by CodeRabbit

  • 新功能

    • 新增对话节奏控制功能,支持在私聊中设置响应延迟,优化对话交互体验
    • 新增内存任务配置支持,用于高质量摘要与知识提取
  • 版本更新

    • 应用版本升级至 1.0.9
    • 配置版本更新

hsd221 and others added 7 commits May 6, 2026 22:29
在 periodic_emoji_maintenance 的自动扫描循环中,
改用 self.emojis(仅包含已注册表情包)构建跳过集合,
替换原先的 _known_emoji_file_paths(包含未注册记录),
避免已有数据库记录但 is_registered=False 的表情包文件被永久跳过。

Closes: 表情包自动注册不触发,手动注册正常的问题
fix: 修复表情包自动扫描跳过未注册表情包的问题
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c1480c91-a18a-4a9d-b8b1-737f0bf16bc3

📥 Commits

Reviewing files that changed from the base of the PR and between e521ee2 and 270266c.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • dashboard/package.json
  • dashboard/src/lib/version.ts
  • dashboard/src/routes/config/model.tsx
  • prompts/en-US/maisaka_timing_gate.prompt
  • prompts/ja-JP/maisaka_timing_gate.prompt
  • prompts/zh-CN/maisaka_timing_gate.prompt
  • pytests/A_memorix_test/test_summary_importer_model_config.py
  • pytests/test_maisaka_timing_gate.py
  • src/A_memorix/core/utils/summary_importer.py
  • src/config/config.py
  • src/config/default_model_config.py
  • src/config/model_configs.py
  • src/emoji_system/emoji_manager.py
  • src/maisaka/builtin_tool/__init__.py
  • src/maisaka/builtin_tool/wait.py
  • src/maisaka/chat_loop_service.py
  • src/maisaka/reasoning_engine.py
  • src/maisaka/runtime.py

概述

此 PR 为 Timing Gate 机制引入了一个新的 "wait" 工具,重新组织了任务配置体系以引入 memory 任务,并重构了汇总模型选择逻辑以支持优先级化的任务回退。版本号在 dashboard、MMC 和模型配置层级均已更新。

变更

Timing Gate Wait 功能与内存任务重构

层级 / 文件(s) 摘要
版本与配置常量
dashboard/package.json, dashboard/src/lib/version.ts, src/config/config.py
Dashboard 版本从 1.0.8 更新至 1.0.9;MMC_VERSION 从 1.0.0-pre.14 更新至 1.0.0-pre.15;MODEL_CONFIG_VERSION 从 1.16.0 更新至 1.16.1。
任务配置模式
src/config/model_configs.py, src/config/default_model_config.py
ModelTaskConfig 中添加了新的 memory: TaskConfig 字段,用于长期内存任务;在默认模板中定义了其配置结构。
仪表板验证逻辑
dashboard/src/routes/config/model.tsx
getRequiredTaskNames(schema) 替换了之前的高级任务检测,使验证能够根据模式定义区分必需任务;使用 taskConfigSchemaRef 存储模式以在验证中使用。
汇总导入器重构
src/A_memorix/core/utils/summary_importer.py
引入 _pick_default_summary_task() 以按优先级(memory → utils → planner)选择默认汇总任务;简化了选择逻辑和回退路径。
Wait 工具实现
src/maisaka/builtin_tool/wait.py
实现了新的 wait 内置工具,接受秒数参数,将运行时转入等待状态,返回成功结果并标记 pause_execution: True
Timing Gate 工具注册与可用性
src/maisaka/builtin_tool/__init__.py
在工具注册表中添加了 wait 工具(stage=timing, chat_scope=private);更新 get_timing_tools() 以接受可用性上下文并按聊天范围过滤。
运行时等待状态
src/maisaka/runtime.py
添加了 _STATE_WAIT 代理状态;实现了等待状态生命周期(_enter_wait_state, _schedule_wait_timeout, _cancel_wait_timeout_task);支持 "timeout" 内部触发器以在超时时转回运行状态。
推理引擎 Timing Gate 增强
src/maisaka/reasoning_engine.py
扩展 _run_timing_gate() 以支持 wait 操作;使用 get_timing_tools(context) 动态验证工具;在循环结束处理中为 wait 添加了单独的分支(timing_wait vs timing_no_reply);更新了无效工具提示文本以包含 wait。
聊天循环服务提示配置
src/maisaka/chat_loop_service.py
添加 _build_timing_gate_wait_rule() 以按区域和聊天范围生成条件化的等待规则提示;扩展 TIMING_GATE_TOOL_NAMES 以包含 wait;向提示上下文添加 timing_gate_wait_rule 参数。
Timing Gate 多语言提示词
prompts/en-US/maisaka_timing_gate.prompt, prompts/ja-JP/maisaka_timing_gate.prompt, prompts/zh-CN/maisaka_timing_gate.prompt
定义了 Timing Gate 的英文、日文、中文提示词,指导模型分析对话节奏并在私有聊天中选择 continue/no_reply/wait 操作;包含可配置的 wait 规则和群聊注意块占位符。
汇总导入器测试
pytests/A_memorix_test/test_summary_importer_model_config.py
更新了模拟的可用模型配置;添加了验证优先级化回退行为的新测试(memory → utils → planner);添加了确保不会回退到 replyer 的测试。
Timing Gate Wait 工具测试
pytests/test_maisaka_timing_gate.py
添加了 _build_runtime_stub() 辅助函数;新增测试验证 wait 仅在私有聊天中可用;添加了测试确认在群聊中 wait 被视为无效工具;更新了现有测试以使用共享运行时桩。
表情符号维护
src/emoji_system/emoji_manager.py
优化了 periodic_emoji_maintenance() 中的扫描逻辑,从内存中的 self.emojis 生成 registered_paths 集合而非依赖 _known_emoji_file_paths

序列图

由于此 PR 引入了新的 wait 工具和相关的运行时状态管理,其中涉及多个组件间的交互,请参考上述 review stack 中的每个层级内的 Mermaid 图表,以了解核心流程如消息处理、Timing Gate 执行和等待状态转换。

代码评审工作量估计

🎯 4 (复杂) | ⏱️ ~60 分钟

可能相关的 PR

  • Mai-with-u/MaiBot#1591: 在配置和模型默认值代码中有重叠变更(添加/修改 src/config/default_model_config.py 和更新版本常量)。
  • Mai-with-u/MaiBot#1588: 修改 SummaryImporter._resolve_summary_model_config() 中的相同逻辑(调整默认和回退模型选择行为及相关测试)。
  • Mai-with-u/MaiBot#1640: 在运行时/引擎中有直接相关的变更(添加 wait 工具、更改 get_timing_tools 签名、更新 Timing Gate 提示和测试、共享运行时等待状态和推理引擎时序逻辑)。
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@SengokuCola SengokuCola merged commit 2c14fd8 into main May 7, 2026
3 of 6 checks passed
@github-project-automation github-project-automation Bot moved this to 已完成 in MaiM to the GATE May 7, 2026
@coderabbitai coderabbitai Bot mentioned this pull request May 10, 2026
6 tasks
@coderabbitai coderabbitai Bot mentioned this pull request May 21, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants