Skip to content

Dev#1611

Merged
SengokuCola merged 12 commits into
mainfrom
dev
May 1, 2026
Merged

Dev#1611
SengokuCola merged 12 commits into
mainfrom
dev

Conversation

@SengokuCola
Copy link
Copy Markdown
Collaborator

@SengokuCola SengokuCola commented May 1, 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

发布说明

  • 功能移除

    • 停用 AgentLite 框架及其相关示例、工具和文档。
  • 新增功能

    • 私聊和群聊现已支持独立的回复频率和上下文窗口配置。
    • 插件系统现支持声明和提供定制化 LLM 提供者。
    • 新增 LLM 缓存统计调试功能,可记录缓存命中率和性能数据。
  • 改进与优化

    • 时间门限判断现采用重试机制(最多3次)以提升稳定性。
    • 优化了历史记录修剪策略,改进上下文窗口管理。
    • 增强了群聊与私聊的区分处理。
  • 配置更新

    • 更新全局配置版本至 8.9.20。
    • 调整了人设提示词格式和默认内容。

SengokuCola and others added 12 commits April 27, 2026 11:18
- Introduced LLM Provider declarations in plugin manifests, allowing plugins to specify their LLM capabilities.
- Implemented validation for LLM Provider declarations to prevent duplicates and conflicts.
- Enhanced the PluginRunner to handle LLM Provider invocation requests, enabling plugins to interact with LLM Providers seamlessly.
- Added a ClientRegistry to manage LLM Provider registrations and ensure no conflicts arise between different plugins.
- Created a PluginLLMClient to facilitate communication with LLM Providers through the plugin runtime.
- Developed tests to ensure proper registration and conflict handling of LLM Providers.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 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: 60117306-463f-41b2-a1d8-368340322195

📥 Commits

Reviewing files that changed from the base of the PR and between 026f737 and 2238c34.

📒 Files selected for processing (100)
  • .gitignore
  • agentlite/CHANGELOG.md
  • agentlite/TEST_PLAN.md
  • agentlite/docs/llm_client.md
  • agentlite/docs/tools.md
  • agentlite/examples/README.md
  • agentlite/examples/custom_tools.py
  • agentlite/examples/llm_client_example.py
  • agentlite/examples/mcp_tools.py
  • agentlite/examples/multi_agent.py
  • agentlite/examples/single_agent.py
  • agentlite/examples/skills/code-reviewer/SKILL.md
  • agentlite/examples/skills/release-process/SKILL.md
  • agentlite/examples/skills_example.py
  • agentlite/examples/subagent_example.py
  • agentlite/examples/tool_suite_example.py
  • agentlite/src/agentlite/__init__.py
  • agentlite/src/agentlite/agent.py
  • agentlite/src/agentlite/config.py
  • agentlite/src/agentlite/labor_market.py
  • agentlite/src/agentlite/llm_client.py
  • agentlite/src/agentlite/mcp.py
  • agentlite/src/agentlite/message.py
  • agentlite/src/agentlite/provider.py
  • agentlite/src/agentlite/providers/__init__.py
  • agentlite/src/agentlite/providers/openai.py
  • agentlite/src/agentlite/skills/__init__.py
  • agentlite/src/agentlite/skills/discovery.py
  • agentlite/src/agentlite/skills/flow_parser.py
  • agentlite/src/agentlite/skills/flow_runner.py
  • agentlite/src/agentlite/skills/models.py
  • agentlite/src/agentlite/skills/skill_tool.py
  • agentlite/src/agentlite/subagent_config.py
  • agentlite/src/agentlite/tool.py
  • agentlite/src/agentlite/tools/__init__.py
  • agentlite/src/agentlite/tools/config.py
  • agentlite/src/agentlite/tools/file/__init__.py
  • agentlite/src/agentlite/tools/file/glob.py
  • agentlite/src/agentlite/tools/file/grep.py
  • agentlite/src/agentlite/tools/file/read.py
  • agentlite/src/agentlite/tools/file/read_media.py
  • agentlite/src/agentlite/tools/file/replace.py
  • agentlite/src/agentlite/tools/file/write.py
  • agentlite/src/agentlite/tools/misc/__init__.py
  • agentlite/src/agentlite/tools/misc/think.py
  • agentlite/src/agentlite/tools/misc/todo.py
  • agentlite/src/agentlite/tools/multiagent/__init__.py
  • agentlite/src/agentlite/tools/multiagent/create.py
  • agentlite/src/agentlite/tools/multiagent/task.py
  • agentlite/src/agentlite/tools/shell/__init__.py
  • agentlite/src/agentlite/tools/shell/shell.py
  • agentlite/src/agentlite/tools/web/__init__.py
  • agentlite/src/agentlite/tools/web/fetch.py
  • agentlite/src/agentlite/tools/web/search.py
  • agentlite/tests/__init__.py
  • agentlite/tests/conftest.py
  • agentlite/tests/integration/__init__.py
  • agentlite/tests/integration/test_agent.py
  • agentlite/tests/integration/test_with_api.py
  • agentlite/tests/mocks/__init__.py
  • agentlite/tests/scenarios/__init__.py
  • agentlite/tests/scenarios/test_cli_debug.py
  • agentlite/tests/scenarios/test_cli_debug_verbose.py
  • agentlite/tests/scenarios/test_cli_operations_real_api.py
  • agentlite/tests/scenarios/test_file_operations.py
  • agentlite/tests/scenarios/test_file_operations_real_api.py
  • agentlite/tests/tools/test_document_kg_tools.py
  • agentlite/tests/unit/__init__.py
  • agentlite/tests/unit/test_config.py
  • agentlite/tests/unit/test_message.py
  • agentlite/tests/unit/test_provider.py
  • agentlite/tests/unit/test_tool.py
  • agentlite/tests/utils.py
  • pytests/config_test/test_config_manager_hot_reload.py
  • pytests/config_test/test_config_manager_startup_upgrade.py
  • pytests/test_llm_provider_registry.py
  • pytests/test_maisaka_timing_gate.py
  • pytests/test_plugin_runtime.py
  • src/chat/replyer/maisaka_expression_selector.py
  • src/chat/replyer/maisaka_generator_base.py
  • src/chat/replyer/replyer_manager.py
  • src/common/utils/utils_config.py
  • src/config/config.py
  • src/config/official_configs.py
  • src/learners/jargon_miner.py
  • src/llm_models/model_client/base_client.py
  • src/llm_models/model_client/plugin_client.py
  • src/llm_models/utils_model.py
  • src/maisaka/chat_loop_service.py
  • src/maisaka/history_post_processor.py
  • src/maisaka/reasoning_engine.py
  • src/maisaka/runtime.py
  • src/plugin_runtime/host/supervisor.py
  • src/plugin_runtime/integration.py
  • src/plugin_runtime/protocol/envelope.py
  • src/plugin_runtime/runner/manifest_validator.py
  • src/plugin_runtime/runner/plugin_loader.py
  • src/plugin_runtime/runner/runner_main.py
  • src/services/llm_cache_stats.py
  • src/services/llm_service.py

总体概览

此PR删除了整个agentlite包及其相关的文档、示例和测试,同时在LLM模型客户端、插件系统和Maisaka对话引擎等方面进行了显著增强,包括新的LLM Provider注册、缓存统计功能和配置升级机制。

变更内容

集群/文件 摘要
agentlite包删除
agentlite/.../*
删除了整个agentlite框架包,包括核心模块(agent、config、llm_client、mcp、message、provider、tool等)、技能系统(discovery、flow_parser、flow_runner等)、工具实现(file、shell、web、misc、multiagent等)、文档、示例和测试文件
LLM Provider注册系统
src/llm_models/model_client/base_client.py, src/llm_models/model_client/plugin_client.py
引入ClientProviderRegistration数据结构取代原有的简单类映射,支持工厂函数、插件所有权追踪和冲突检测;新增PluginLLMClient代理类通过RPC调用第三方提供商
插件运行时LLM支持
src/plugin_runtime/host/supervisor.py, src/plugin_runtime/protocol/envelope.py, src/plugin_runtime/runner/manifest_validator.py, src/plugin_runtime/runner/runner_main.py, src/plugin_runtime/integration.py
添加LLM Provider声明、验证、注册和冲突检测机制;实现invoke_llm_provider RPC端点;在插件生命周期中管理提供商注册和注销
LLM缓存统计
src/services/llm_cache_stats.py
新增模块用于记录、分析和可视化LLM提示缓存使用情况,包括命中率统计、理论缓存计算、提示漂移诊断和HTML报告生成
LLM服务增强
src/services/llm_service.py, src/llm_models/utils_model.py
集成缓存统计记录;引入LLMRequest兼容性包装器用于遗留代码;调整日志级别
配置系统升级
src/config/config.py, src/config/official_configs.py
实现自动配置迁移机制,新增私聊特定参数(private_talk_valuemax_private_context_size),调整版本号和默认值
Maisaka对话引擎改进
src/maisaka/chat_loop_service.py, src/maisaka/reasoning_engine.py, src/maisaka/runtime.py, src/maisaka/history_post_processor.py
优化LLM客户端路由、时序门重试逻辑、上下文窗口管理和历史记录修剪算法
工具和配置工具
src/common/utils/utils_config.py, src/chat/replyer/maisaka_expression_selector.py, src/chat/replyer/maisaka_generator_base.py, src/chat/replyer/replyer_manager.py, src/learners/jargon_miner.py
降低日志级别、优化配置查询逻辑、改进性格提示生成
测试增强
pytests/config_test/test_config_manager_startup_upgrade.py, pytests/test_llm_provider_registry.py, pytests/test_maisaka_timing_gate.py, pytests/test_plugin_runtime.py
新增配置升级、LLM Provider注册冲突检测、时序门重试验证等测试用例

序列图

sequenceDiagram
    participant Plugin as 插件
    participant Supervisor as 主机监管器
    participant Registry as 客户端注册表
    participant LLMClient as LLM客户端实例
    participant Provider as LLM提供商

    Plugin->>Supervisor: 注册插件(llm_providers)
    Supervisor->>Registry: 验证提供商替换
    Supervisor->>Registry: 注册提供商(factory)
    Supervisor->>LLMClient: 创建PluginLLMClient实例
    LLMClient->>Supervisor: invoke_llm_provider(client_type)
    Supervisor->>Plugin: RPC调用提供商方法
    Plugin->>Provider: 执行LLM操作
    Provider-->>Plugin: 返回响应
    Plugin-->>Supervisor: 返回结果
    Supervisor-->>LLMClient: 返回APIResponse
Loading
sequenceDiagram
    participant Runtime as Maisaka运行时
    participant HistoryProcessor as 历史处理器
    participant LLMService as LLM服务
    participant CacheStats as 缓存统计

    Runtime->>HistoryProcessor: 处理聊天历史
    HistoryProcessor->>HistoryProcessor: 计算修剪目标
    HistoryProcessor->>HistoryProcessor: 迭代删除最早消息
    HistoryProcessor->>Runtime: 返回修剪结果
    Runtime->>LLMService: 生成响应
    LLMService->>LLMService: 序列化消息为缓存统计文本
    LLMService->>CacheStats: 记录缓存使用情况
    CacheStats->>CacheStats: 更新聚合统计
    LLMService-->>Runtime: 返回响应
Loading

代码审查工作量估计

🎯 5 (严重) | ⏱️ ~120+ 分钟

可能相关的PR

  • feat: add a subagent frame #1578: 该PR原始引入了整个agentlite包框架,而当前PR完全删除了该包及其所有组件,两个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 8401bc2 into main May 1, 2026
2 of 4 checks passed
@github-project-automation github-project-automation Bot moved this to 已完成 in MaiM to the GATE May 1, 2026
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