Skip to content

Dev#1694

Merged
SengokuCola merged 37 commits into
mainfrom
dev
May 15, 2026
Merged

Dev#1694
SengokuCola merged 37 commits into
mainfrom
dev

Conversation

@SengokuCola
Copy link
Copy Markdown
Collaborator

@SengokuCola SengokuCola commented May 15, 2026

加上内存问题修复,并放在更靠前的位置:

Maisaka 新增主动唤醒聊天和新建聊天能力,插件可触发麦麦主动参与指定聊天流或创建新的聊天。
统计系统修复大数据量下的内存溢出问题,并改为聚合服务降低统计时的内存占用。
Maisaka 新增内置图片发送动作,可把上下文消息或工具返回结果中的图片重新发送到聊天中。
表达方式选择升级为精细选择模式,会根据当前语境从候选表达中挑选更合适的表达。
表达学习新增 AI 审核日志与人工恢复能力,WebUI 可查看拒绝原因并救回被误拒的表达方式。
插件新增文本嵌入能力,可调用宿主 embedding 模型生成单条或批量向量。
插件可声明核心工具能力,宿主工具检索和调用更灵活。
Maisaka 上下文优化增强,可裁切部分 assistant 历史并折叠工具记录,降低 token 消耗。
Maisaka 新增合并版 timing prompt,可将节奏判断合入 Planner,减少独立阶段开销。
Maisaka 多模态消息展示优化,图片和工具返回媒体会更稳定地保留在上下文中。
消息图片支持持久化保存,历史消息中的图片更不容易丢失。
A_memorix 人物画像迭代机制优化,画像更新更稳定、内容组织更清晰。
WebUI 推理过程页面优化,阶段、工具调用和 prompt 记录展示更清晰。
WebUI 插件统计功能恢复,可重新查看插件运行与调用统计。
WebUI 插件市场和插件详情页优化,安装状态、市场信息和运行状态展示更清晰。
WebUI 更新流程优化,更新 Dashboard 时会保留用户插件文件。
WebUI 不再自动更新 Dashboard,避免启动时意外改动前端资源。
WebUI MCP 设置页修复服务名称输入框失焦问题。
WebUI 默认配色调整,整体视觉更统一。
新增聊天速度配置,可调整模拟打字等待时间。
工具群权限判断修复,工具在群聊中的可用性控制更准确。
工具媒体结果提示规范化,模型和用户看到的工具结果说明更一致。
MCP 连接兼容性增强,相关导入和连接流程更稳定。
依赖版本更新并固定 maim-message 版本,降低环境差异导致的问题。

Summary by CodeRabbit

发布说明

  • 新功能

    • 新增表达方式AI审核日志浏览与人工审核恢复功能
    • 推理过程浏览界面增加阶段/会话二级筛选导航
    • 新增插件主动触发和图片发送内置工具
    • 支持上下文优化和独立Timing Gate配置开关
  • 优化改进

    • 多处加载提示改为"Thinking..."动画效果
    • 新增插件列表和配置数据缓存机制
    • 回复生成支持失败重试流程
    • 版本更新至1.1.3

SengokuCola and others added 30 commits May 13, 2026 11:56
feat(A_memorix):更加优化的人物画像迭代机制
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

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: 4939e307-83bb-49e0-891a-40953a36b9f4

📥 Commits

Reviewing files that changed from the base of the PR and between 4b47984 and ed90c13.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (137)
  • AGENTS.md
  • changelogs/changelog.md
  • dashboard/package.json
  • dashboard/src/components/RestartingOverlay.legacy.tsx
  • dashboard/src/components/dynamic-form/__tests__/DynamicField.test.tsx
  • dashboard/src/components/expression-reviewer.tsx
  • dashboard/src/components/index.ts
  • dashboard/src/components/layout/LogoArea.tsx
  • dashboard/src/components/memory/MemoryEpisodeManager.tsx
  • dashboard/src/components/memory/MemoryMaintenanceManager.tsx
  • dashboard/src/components/memory/MemoryProfileManager.tsx
  • dashboard/src/components/plugin-stats.tsx
  • dashboard/src/components/restart-overlay.tsx
  • dashboard/src/components/route-pending-fallback.tsx
  • dashboard/src/components/share-pack-dialog.tsx
  • dashboard/src/i18n/locales/en.json
  • dashboard/src/i18n/locales/ja.json
  • dashboard/src/i18n/locales/ko.json
  • dashboard/src/i18n/locales/zh.json
  • dashboard/src/index.css
  • dashboard/src/lib/config-api.ts
  • dashboard/src/lib/expression-api.ts
  • dashboard/src/lib/pack-api.ts
  • dashboard/src/lib/plugin-api/marketplace.ts
  • dashboard/src/lib/plugin-stats.ts
  • dashboard/src/lib/reasoning-process-api.ts
  • dashboard/src/lib/system-api.ts
  • dashboard/src/lib/theme/palette.ts
  • dashboard/src/lib/theme/tokens.ts
  • dashboard/src/lib/version.ts
  • dashboard/src/routes/auth.tsx
  • dashboard/src/routes/chat/index.tsx
  • dashboard/src/routes/config/adapter.tsx
  • dashboard/src/routes/config/bot.tsx
  • dashboard/src/routes/config/bot/types.ts
  • dashboard/src/routes/config/model.tsx
  • dashboard/src/routes/config/modelProvider/index.tsx
  • dashboard/src/routes/config/prompts.tsx
  • dashboard/src/routes/index.tsx
  • dashboard/src/routes/mcp-settings.tsx
  • dashboard/src/routes/monitor/maisaka-monitor.tsx
  • dashboard/src/routes/person.tsx
  • dashboard/src/routes/plugin-config.tsx
  • dashboard/src/routes/plugin-detail.tsx
  • dashboard/src/routes/plugins/PluginCard.tsx
  • dashboard/src/routes/plugins/index.tsx
  • dashboard/src/routes/reasoning-process.tsx
  • dashboard/src/routes/resource/emoji/EmojiDialogs.tsx
  • dashboard/src/routes/resource/expression/ExpressionDialogs.tsx
  • dashboard/src/routes/resource/expression/ExpressionList.tsx
  • dashboard/src/routes/resource/expression/ExpressionReviewLogPanel.tsx
  • dashboard/src/routes/resource/expression/index.tsx
  • dashboard/src/routes/resource/jargon/JargonList.tsx
  • dashboard/src/routes/resource/knowledge-base.tsx
  • dashboard/src/routes/resource/knowledge-base/tabs/DeleteTab.tsx
  • dashboard/src/routes/resource/knowledge-base/tabs/FeedbackTab.tsx
  • dashboard/src/routes/resource/knowledge-base/tabs/ImportTab.tsx
  • dashboard/src/routes/resource/knowledge-graph/GraphDialogs.tsx
  • dashboard/src/routes/survey/maibot-feedback.tsx
  • dashboard/src/routes/survey/webui-feedback.tsx
  • dashboard/src/types/expression.ts
  • prompts/en-US/.meta.toml
  • prompts/en-US/maisaka_chat_merged_timing.prompt
  • prompts/ja-JP/.meta.toml
  • prompts/ja-JP/maisaka_chat_merged_timing.prompt
  • prompts/zh-CN/.meta.toml
  • prompts/zh-CN/maisaka_chat_merged_timing.prompt
  • pyproject.toml
  • pytests/A_memorix_test/test_person_profile_service.py
  • pytests/common_test/test_expression_learner.py
  • pytests/common_test/test_maisaka_expression_selector.py
  • pytests/test_chat_session_data_model.py
  • pytests/test_context_message_fallback.py
  • pytests/test_maisaka_builtin_context.py
  • pytests/test_maisaka_history_post_processor.py
  • pytests/test_maisaka_person_profile_injector.py
  • pytests/test_message_image_persistence.py
  • pytests/test_prompt_cli_renderer_multimodal_html.py
  • pytests/test_tool_availability.py
  • pytests/webui/test_expression_routes.py
  • requirements.txt
  • scripts/analyze_bot_phrase_patterns.py
  • scripts/evaluate_bot_phrase_regex_capture.py
  • src/A_memorix/core/utils/person_profile_service.py
  • src/A_memorix/core/utils/profile_text.py
  • src/chat/message_receive/message.py
  • src/chat/replyer/maisaka_expression_selector.py
  • src/chat/replyer/maisaka_generator_base.py
  • src/chat/utils/statistic.py
  • src/chat/utils/utils.py
  • src/common/data_models/message_component_data_model.py
  • src/common/database/database_model.py
  • src/common/database/migrations/builtin.py
  • src/common/database/migrations/v8_to_v9.py
  • src/common/runtime_loop.py
  • src/common/utils/utils_message.py
  • src/config/config.py
  • src/config/config_upgrade_hooks.py
  • src/config/official_configs.py
  • src/core/tooling.py
  • src/learners/expression_auto_check_task.py
  • src/learners/expression_learner.py
  • src/learners/expression_review_store.py
  • src/main.py
  • src/maisaka/builtin_tool/__init__.py
  • src/maisaka/builtin_tool/reply.py
  • src/maisaka/builtin_tool/send_image.py
  • src/maisaka/builtin_tool/tool_search.py
  • src/maisaka/chat_loop_service.py
  • src/maisaka/context_messages.py
  • src/maisaka/display/prompt_cli_renderer.py
  • src/maisaka/history_post_processor.py
  • src/maisaka/person_profile_injector.py
  • src/maisaka/planner_message_utils.py
  • src/maisaka/reasoning_engine.py
  • src/maisaka/runtime.py
  • src/mcp_module/connection.py
  • src/plugin_runtime/capabilities/core.py
  • src/plugin_runtime/capabilities/data.py
  • src/plugin_runtime/capabilities/registry.py
  • src/plugin_runtime/component_query.py
  • src/plugin_runtime/integration.py
  • src/plugin_runtime/runner/manifest_validator.py
  • src/plugin_runtime/runner/plugin_loader.py
  • src/plugin_runtime/runner/runner_main.py
  • src/services/statistics_aggregation_service.py
  • src/webui/dashboard_update.py
  • src/webui/routers/expression.py
  • src/webui/routers/plugin/__init__.py
  • src/webui/routers/plugin/management.py
  • src/webui/routers/plugin/stats_proxy.py
  • src/webui/routers/reasoning_process.py
  • src/webui/routers/system.py
  • src/webui/services/git_mirror_service.py
  • src/webui/webui_server.py
  • tests/test_maisaka_builtin_send_image.py
  • tests/test_mcp_connection_imports.py

Walkthrough

新增插件统计代理与前端缓存/摘要映射;引入表达方式AI审核日志全链路;人物画像结构化与注入;运行时与工具可见性、媒体/消息处理、历史优化、主动触发与能力注册;数据库统计聚合与迁移;移除WebUI版本检测并线程化WebUI;广泛UI与配置更新。

Changes

Maisaka 运行时与工具链升级

Layer / File(s) Summary
回复生成重试与表达选择Hook扩展
src/chat/replyer/*, src/maisaka/builtin_tool/reply.ts
回复生成支持after_response Hook与重试;表达选择透传reply_tool_args并允许Hook覆盖选择;reply工具传递reply_tool_args。
工具可见性与可用性上下文
src/core/tooling.py, src/plugin_runtime/component_query.ts, src/maisaka/reasoning_engine.py
按执行上下文筛选与暴露工具;ToolSpec标注visibility并控制enabled;ReasoningEngine基于阶段/可见性过滤内置工具。
主动触发与能力注册
src/maisaka/runtime.py, src/plugin_runtime/capabilities/*, src/plugin_runtime/capabilities/registry.ts, 测试
运行时支持enqueue_proactive_task并作为触发;新增llm.embed、chat.open_session、maisaka.proactive.trigger能力与测试覆盖。
媒体与消息编码/渲染处理
src/maisaka/display/prompt_cli_renderer.ts, src/maisaka/context_messages.ts, src/chat/message_receive/message.py, src/common/utils/utils_message.py, 测试
新增DictComponent/file摘要与完整文本;识别多种图片content part;工具结果媒体XML化;消息入库持久化图片二进制并验证。
历史优化与打字速度
src/maisaka/history_post_processor.py, src/chat/utils/statistic.py, src/chat/utils/utils.py, 配置与测试
开启上下文优化时折叠旧助手消息与工具链;统计改用聚合接口;typing_speed影响打字耗时。
内置发送图片工具与测试
src/maisaka/builtin_tool/send_image.py, src/maisaka/builtin_tool/__init__.py, 测试
新增send_image工具,通过媒体索引/消息定位并发送图片,注册为action阶段工具。
Planner前缀与上下文可见文本调整
src/maisaka/planner_message_utils.py, 测试
Planner消息前缀改为XML风格;可见文本引用与图片占位断言同步。

表达方式AI审核日志:存储、接口与前端

Layer / File(s) Summary
后端日志存取与救回聚合
src/learners/expression_review_store.py
JSON日志读写、时间解析、救回聚合、最近日志筛选与单条查询。
WebUI 审核路由与模型
src/webui/routers/expression.py
新增GET/POST审核日志接口,支持人工通过恢复表达;计数与distinct优化。
前端类型、API与面板UI
dashboard/src/types/*, dashboard/src/lib/expression-api.ts, dashboard/src/routes/resource/expression/*
类型与API封装;Panel列表/过滤/救回;整合至管理页的reviewLogs视图。
端到端路由测试
pytests/webui/test_expression_routes.py
验证读取日志与人工通过恢复表达流程。

插件市场与统计:代理、缓存与前端集成

Layer / File(s) Summary
FastAPI 统计代理
src/webui/routers/plugin/stats_proxy.py, src/webui/routers/plugin/__init__.py
透传插件统计请求到上游服务。
前端统计与市场缓存
dashboard/src/lib/plugin-stats.ts, dashboard/src/lib/plugin-api/marketplace.ts
统计改走代理并鉴权;新增summary;市场列表缓存与并发去重。
插件列表/详情/卡片集成
dashboard/src/routes/plugins/*, dashboard/src/routes/plugin-detail.tsx
以manifest.id绑定统计与下载;展示likes;采用缓存与统计摘要。

人物画像结构化与注入

Layer / File(s) Summary
结构化文本与服务分桶
src/A_memorix/core/utils/profile_text.py, person_profile_service.py, person_profile_injector.py
结构化画像文本生成/解析/注入;LLM+规则证据分桶并合并。
注入与分桶测试
pytests/*person_profile*
验证分桶防呆与注入裁剪输出。

推理过程浏览增强

Layer / File(s) Summary
后端列表与解析增强
src/webui/routers/reasoning_process.py
返回stage/session元信息与replyer输出预览;扩展搜索维度。
前端两步式浏览与格式化
dashboard/src/routes/reasoning-process.tsx, 类型
阶段卡片选择与记录浏览;标题/副标题格式化。

统计聚合与数据库迁移

Layer / File(s) Summary
模型与迁移
src/common/database/*
新增小时聚合表与游标;v8->v9迁移脚本与回填。
聚合服务与统计任务
src/services/statistics_aggregation_service.py, src/chat/utils/statistic.py
增量聚合与查询;统计任务前置刷新并改用聚合接口。

WebUI 线程化与版本检测移除

Layer / File(s) Summary
线程化WebUI服务与主循环桥接
src/common/runtime_loop.py, src/webui/webui_server.py, src/main.py
线程内事件循环承载WebUI;main绑定/清理主循环;跨线程reload/shutdown。
移除WebUI版本检测后端与前端依赖
src/webui/routers/system.py, dashboard/src/lib/system-api.ts, dashboard/src/components/layout/LogoArea.tsx, dashboard/src/routes/index.tsx
移除/dashboard-version接口与前端展示/调用。

插件管理更新流程优化

Layer / File(s) Summary
管理路由与Git拉取
src/webui/services/git_mirror_service.py, src/webui/routers/plugin/management.py
更新插件改为git pull,失败不再清理目录。

MCP设置与可选依赖兼容

Layer / File(s) Summary
设置页与连接导入兼容
dashboard/src/routes/mcp-settings.tsx, src/mcp_module/connection.py, 测试
MCP服务器使用_uuid并保存前剔除;连接模块兼容新旧streamable-http客户端并测试。

Dashboard与配置杂项更新

Layer / File(s) Summary
配置缓存API与页面接入
dashboard/src/lib/config-api.ts, dashboard/src/routes/*config*, dashboard/src/routes/index.tsx
新增缓存API并在配置页与首页使用。
主题颜色与版本号
dashboard/src/index.css, dashboard/src/lib/theme/*, 版本常量
切换主题主色为橙色;版本号更新。
配置项增删与升级钩子
src/config/official_configs.py, src/config/config_upgrade_hooks.py
新增上下文优化/独立计时门/打字速度与表达精细选择;移除auto_update_dashboard;升级钩子。
文案与UI细节调整
多处组件与i18n
大量加载文案统一为“Thinking...”,微调样式与加载占位。
文档与changelog
AGENTS.md, changelogs/changelog.md
新增debug规范与未发布变更整理。
依赖与Python版本调整
pyproject.toml, requirements.txt
锁定maim-message==0.6.8,Python>=3.12。

Sequence Diagram(s)

(不满足全部条件,已省略)

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • Mai-with-u/MaiBot#1651 — 涉及WebUI“dashboard version”功能的增添/移除,与本PR对该功能的删除形成直接对照。
  • Mai-with-u/MaiBot#1668 — 调整插件市场fetchPluginListmanifest.id的识别逻辑,与本PR的统计与ID关联策略一致。
  • Mai-with-u/MaiBot#1692 — MCP设置引入/复用_uuid并在保存前剔除的相同代码路径,和本PR对同文件的修改直接相关。
✨ 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

@SengokuCola SengokuCola merged commit ef61571 into main May 15, 2026
3 of 6 checks passed
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.

3 participants